/* Filename: switchError1.java * Description: This code contains errors and will be used as part of * an in-class debugging exercise */ import java.util.*; public class switchError1{ // main application entry point public static void main(String [] args){ // declare some variables and a Scanner int score = 0; char grade = 'A'; Scanner stdin = new Scanner(System.in); // prompt user for input and read it in using the Scanner System.out.println("Please enter your score: "); score = stdin.nextInt(); // handle the user input switch(score) { case (score > 90): grade = 'A'; break; case (score > 80): grade = 'b'; break; case (score > 70): grade = 'C'; break; case(score > 60): grade = 'D'; break; default: grade = 'F'; } System.out.println("Your grade is: " + grade); } }