snakehead_diver
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...
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...
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("qui t")) break;
System.out.print("Enter score: ");
num = scan.nextInt();
if (num >= 90)
System.out.println("Studen t score is A")
}
the code is
while (true)
{
System.out.print("Enter student name: ")
name = scan.nextLine();
if ( name.equalsIgnoreCase("qui
System.out.print("Enter score: ");
num = scan.nextInt();
if (num >= 90)
System.out.println("Studen
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Stillgiving me this output;
Name: Rob
Score: 95
Grade: AEnter score:
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
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
ASKER
mlmcc - Thanks for your solution. It helps a lot for a beginner like me.
What code do you have thus far?
mlmcc