Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Why doesn't my code work? Here is my code and here is what zybooks gives me! import java.util.Scanner; public class Grades { public static void
Why doesn't my code work? Here is my code and here is what zybooks gives me!
import java.util.Scanner; public class Grades { public static void main(String [] Args) { Scanner Scnr = new Scanner(System.in); //Declaring required variables int gradesA = 0; int gradesB = 0; int gradesC = 0; int gradesD = 0; int gradesF = 0; int count=0; System.out.println("Enter the list of exam scores (1-100). Enter any negative score to end..."); int num = Scnr.nextInt(); while (num > 0) { if (num >= 90 && num = 80 && num = 70 && num = 60 && num
} }
Input 98 95 87 86 83 92 85 78 74 72 81 71 69 63 50 43 -1 Enter the list of exam scores (1-100). Enter any negative score to en Total number of grades = 16 Number of A's = 3 Your output Number of B's = 5 Number of C's = 4 Number of D's = 2 Number of F's = 2 tttttttttttt Expected output Enter a grade: Enter a grade: Enter a grade: Enter a grade: Enter a grade: Enter a grade: + Enter a grade: - Enter a grade: Enter a grade: Enter a grade: Enter a grade: Enter a grade: Enter a grade: Enter a grade: - Enter a grade: + Enter a grade: Enter a grade: Total number of grades = 16 Number of A's = 2. Number of A-'s = 1+ Number of B+'s = 1+ Number of B's = 3 Number of B-'s = 1 Number of C+'s = 1 Number of C's = 1 Number of C-'s = 2 Number of D's = 2 Number of F's = 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started