Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program 01. This program will print out the letter grade according to the score.

ID: 3744568 • Letter: P

Question

Program 01. This program will print out the letter grade according to the score. When the program runs, it displays this message, let user input double score, then prints out the corresponding letter grade: Use this rule to determine the letter grade: A: 97-100 A: 92-96 A: 90-91 Bt: 87-89 B: 82-86 B: 80-81 Ct: 77-79 C: 72-76 C:70-71 D: 60-69 F:

Explanation / Answer

import java.util.Scanner; public class ScoreToGrade { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a double score: "); double score = in.nextDouble(); String grade; if(score >= 97) { grade = "A+"; } else if(score >= 92) { grade = "A"; } else if(score >= 90) { grade = "A-"; } else if(score >= 87) { grade = "B+"; } else if(score >= 82) { grade = "B"; } else if(score >= 80) { grade = "B-"; } else if(score >= 77) { grade = "C+"; } else if(score >= 72) { grade = "C"; } else if(score >= 70) { grade = "C-"; } else if(score >= 60) { grade = "D"; } else { grade = "F"; } System.out.println("Your letter grade is: " + grade); } }