Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW1_done #14

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

public class Task1 {
public static double calculateP(double a) {
return 0;

return 4 * a;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

public class Task2 {
public static int getMeters(int centimeters) {
return 0;

return centimeters / 100;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

public class Task3 {
public static boolean isBetween(int a, int b, int c) {
return false;

if ((a <= b && b <= c) || (a >= b && b >= c)) {
return true;
} else {
return false;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
public class Task4 {

public static double getSumOfGreatest(double a, double b, double c) {
return 0;
}
if (a < b && b < c) {
return c + b;
}
if (a > b && b > c) {
return b + a;
}
else {
return a + c;
}


}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format you code before commit, you can use IDEA shortcut: CTRL+ALT+L.

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

public class Task5 {
public static double calculateA(double x, double y, double z) {
return 0;
return ((2 * Math.sin(x - Math.PI / 6) * calculateB(z)) / (1 / 2.0 + (Math.pow(Math.sin(y), 2))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's quite hard to read such expressions. It'll be easier for understanding if you'll split it into some pretty parts, like top-part of expression, bottom-part of expression.

But, anyway, it do pass all the tests.

}

private static double calculateB(double z) {
return 0;
return 1 + (Math.pow(z, 2)) / (3 + ((Math.pow(z, 2)) / 5));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

public class Task6 {
public static double calculateS(double x) {
return 0d;
}
return (1 + (x * (((Math.pow(x, 2) *x) *x) / (2 * (3*2) * (4*3*2)))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not correct solution.
Try to solve it step-by-step.
Also you can take look at other students solutions.


}


public static double calculateZ(double x, double y) {
return 0d;

return Math.sin(Math.pow(x, 3)) + Math.pow(Math.cos(y), 2);
}
}