Question: I have the following JAVA program given to me and was asked to complete steps 1-4. I have done steps 1, 2 and 3 but

I have the following JAVA program given to me and was asked to complete steps 1-4. I have done steps 1, 2 and 3 but need help finishing step 4!

import java.util.Scanner; import java.text.DecimalFormat; public class TestAverageAndGrade{ public static void main(String[] args) { double score1, score2, score3, score4, score5; double average; // The average test score Scanner keyboard = new Scanner(System.in); DecimalFormat fmt = new DecimalFormat("0.00"); System.out.print("Enter five test scores: "); score1 = keyboard.nextDouble(); score2 = keyboard.nextDouble(); score3 = keyboard.nextDouble(); score4 = keyboard.nextDouble(); score5 = keyboard.nextDouble(); //step3: Call the method caclAverage to get the average, //and print it average = calcAverage(score1,score2,score3,score4,score5); System.out.println("Average is " +average); //step4: call the method determineGrade and print the grade for average grade = determineGrade{ }// end of main method /*step1: The calcAverage method calculates the average of five test scores.*/ public static double calcAverage(double s1, double s2, double s3, double s4, double s5) {double average = (s1+s2+s3+s4+s5)/5.0; return average;} /*step2: The determineGrade method determines the letter grade for a numeric test score.*/ public static char determineGrade(double a) {char grade; if(a>=90) grade='A'; else if(a>=80) grade='B'; else if(a>=70) grade='C'; else if(a>=60) grade='D'; else grade='F'; return grade;}

} //end of class TestAverageAndGrade

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!