Hello guys, I need your help. I want to know why the average score and grade are wrong? Please give me a hint how to solve this problem. Thanks in advance.
Output
Enter your quiz 1 score: 4
Enter your quiz 2 score: 4
Enter your quiz 3 score: 4
The average score is: 0.0
The quiz grade is: A
import java.util.Scanner; public class Questiontwo { public static void main(String [] args) { Scanner input = new Scanner(System.in); float score = 0; float averagescore = 0; String grade = "A"; for (int i = 1; i < 4; i++) { System.out.print("Enter your quiz " + i + " score: "); score = input.nextFloat(); } System.out.println("The average score is: " + averagescore); System.out.println("The quiz grade is: " +grade); } public static float GetAverageScore(float averagescore, float score) { averagescore = averagescore + score; return averagescore; } public static String GetQuizGrade(float averagescore, String grade) { if (averagescore >= 8 && averagescore <= 10) { grade = "A"; return grade; } else if (averagescore >= 5 && averagescore <= 7.99) { grade = "B"; return grade; } else if (averagescore >= 0 && averagescore <= 4.99) { grade = "C"; return grade; } else { grade = "F"; return grade; } } }