Your methods need some work:
You should do the calculations using the values that are passed in as parameters
You should return the answer via a "return" statement.
So - you don't need any of the variables you declared on lines 3-9
When you have fixed these you can write a main method that calls your methods with some test values and prints the returned values.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
You still have those myXXX names where you should just have the names of the parameters in the methods, and you have not declared the variables you use for the return values. Compile your code before posting it - the compiler will tell you about errors like those.
Because all your methods are static you don't need to create any objects.
Every Java program needs a "main" method. You must have seen this in your course so far. In your main method you can call your other methods, passing in test data, and print the results they return.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
In your main method you can do stuff like
System.out.println(hypotenuse(3.0, 4.0));
if your code is correct it will print the answer 5.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073