import java.util.Scanner;
public class GradeOMatic
{
public static void main(String[] args)
{
Scanner scanUserInput = new Scanner(System.in);
System.out.print("Grade Received (%): ");
int n = scanUserInput.nextInt();
if (n >= 70)
if (n >= 80)
if (n >= 90)
System.out.println("Excellent!");
else
System.out.println("Good!");
else
System.out.println("Average.");
else
System.out.println("You Stink!"); //just kidding it's System.out.println("Bad Times!");
}
}
This code displays the appropriate comment when percentage scores are entered.
(With help from the code in Challenge026)
Hi Ry, explain "(With help from the code in Challenge026)" a bit further.
ReplyDeleteBecause the code is ran as a test, i figured that if I were to use the import java.util.Scanner; and the Scanner scanUserInput = new Scanner(System.in); , the input/output is basically the same template, and from there, I simply inserted the different cases and scenarios
ReplyDeleteWere you working with another learner when deriving this code, or did you do it solo? Thank you.
ReplyDeleteI worked solo
ReplyDeleteVery well, 50 XPs awarded for this completion.
ReplyDelete