Link to home
Start Free TrialLog in
Avatar of snakehead_diver
snakehead_diverFlag for United States of America

asked on

Grade conversion

I would like to create a java code that converts students numeric grades to a letter grade.
90 to 100 is A; 80 to 89 is B; 70 to 70 is C; 60 to 69 is D else is F
example target output:
Name: John
Score: 89
Grade: B

Name: Rob
Score: 95
Grade: A
 
and so on...
Avatar of Mike McCracken
Mike McCracken

This reads like a school exercise?  If so EE cannot do your work for you but rther can help with specific problems and help you reach a solution.

What code do you have thus far?

mlmcc
Avatar of snakehead_diver

ASKER

I am trying to create a simple JAVA code but is not looping the way I expect itto loop.

the code is

while (true)
{
   System.out.print("Enter student name:  ")
   name = scan.nextLine();
   if ( name.equalsIgnoreCase("quit")) break;
   System.out.print("Enter score:  ");
   num = scan.nextInt();
     if (num >= 90)
     System.out.println("Student score is A")
}
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Stillgiving me this output;

Name: Rob
Score: 95
Grade: AEnter score:
The way you have it that is what you will get.  

Your output doesn't match the code in either my example or yours.  Can you cut and paste the exact code.

What result do you want.

mlmcc
mlmcc - Thanks for your solution. It helps a lot for a beginner like me.