7.3.1. WrMethods-WE3-P1ΒΆ
Subgoals for Writing Methods
Define method header based on problem
Define return statement at the end
Define method body/logic
Determine types of logic (expression, selection, loop, etc)
Define internal variables
Write statements
Methods-WE3-P1
Put the code in the right order to create a program that has a public method that returns a String and accepts an integer parameter and returns a flavor of ice cream. There is also a main program that calls the method twice.
Put the code in the right order to create a program that returns a String and accepts as parameters a double and a String, and concatenates the two values as a temperature along with its base scale. There is also a main program that calls the method twice, once with Celsius and once with Fahrenheit.
Put the code in the right order to create a program that returns a double, and accepts as parameters 3 integers, and calculates the average of the inputs. There is also a main program that calls the method twice with different values.