import java.util.*; import javax.swing.*; //Assign a test grade on the following scale // Score Grade // 80 .. 100 GOOD // 60 .. 79 FAIR // 0 .. 59 POOR // public class Lab04Exercise1 { public static void main(String[] args) { String input = JOptionPane.showInputDialog(null, "Enter an (integer) test score 0 .. 100"); int score = Integer.parseInt(input); if (score < 0 || score > 100) throw new RuntimeException("Invalid Score " + score + " Entered"); String grade; if (score > 80) grade = "GOOD"; if (score > 60) grade = "FAIR"; grade = "POOR"; JOptionPane.showMessageDialog(null, "Score: " + score + " " + grade); } }