141k views
5 votes
Write the method declaration for a public class method named calculateAverage() that has double parameters firstNum, secondNum, thirdNum and returns a double value?

User Cibeli
by
8.3k points

1 Answer

5 votes

Final answer:

The method declaration for a public class method named calculateAverage() with double parameters and return value.

Step-by-step explanation:

The method declaration for a public class method named calculateAverage() that has double parameters firstNum, secondNum, thirdNum and returns a double value can be written as:

public static double calculateAverage(double firstNum, double secondNum, double thirdNum) {

//code to calculate the average of the three numbers goes here

return average;

}

User Haakym
by
8.2k points