Section 9.2 Write Method Headers-WE1-P1
Subgoals for Writing Methods.
Subsection 9.2.1
GIVEN
For questions 1 through 3, fill in the blanks of the following code, which is a public method header for the method
politics
that returns a String and doesn’t accept any parameters.
_______ _______ politics (_______) { /* logic */ }
A B C
Exercises Exercises
2.
3.
GIVEN
For questions 4 through 8, fill in the blanks of the following code. Write the method header for a public method that returns an integer and requires the following parameters: one integer, one double, and one String (in that order) and will calculate the weight of stress on your shoulders.
_______ _______ backpain (_______ one, _______ two, _______ three)
A B C D E
{
/* logic */
}
4.
5.
6.
7.
8.
GIVEN
For questions 9 through 12, fill in the blanks of the following code, which is a private method header that returns a String and requires as parameters a double and a String (in that order) and calculates the temperature of a planet at dusk on the third monday of the current month.
_______ _______ leonardo (_______ one, _______ two) { /* logic */ }
A B C D
9.
10.
11.
12.
You have attempted 1 of 2 activities on this page.