Question: Java.Write the body for the integer method called daysOfFreezing, given the header and the call in main shown below. Use the constant FREEZING in your
Java.Write the body for the integer method called daysOfFreezing, given the header and the call in main shown below. Use the constant FREEZING in your code.
public class ColdOnes {
const int FREEZING = 32; public static void main(String args[]) { Scanner stdin = new Scanner(System.in); int temperature[31]; System.out.print("Enter the low temperature for 31 days: "); for (int i=0; i < 31; i++) {
temperature[i] = stdin.nextInt();
} System.out.println("Days below freezing: " +daysOfFreezing(temperature)); } public static int daysOfFreezing(int farenheit[]) { // write this method body }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
