// Short program to interact with a user and print out what grade they // earned depending on the percentage they give import java.util.*; public class Grades { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("What percentage did you earn? "); int percent = console.nextInt(); if (percent >= 90) { System.out.println("You got an A!"); } else if (percent >= 80) { // implied that percent < 90 System.out.println("You got an B!"); } else if (percent >= 70) { System.out.println("You got an C!"); } else if (percent >= 60) { System.out.println("You got an D!"); } else { // percent < 60 System.out.println("You got an F!"); } System.out.println("congrats on your grade!"); } }