Java tutorial : How to write a program to show a test grade

pc ads top

Importjava.util.*

Public class grade
{
Public static void main (string [] args),

{
Scanner input = new scanner (system.in),
Int score,
String grade,
System.out.println ("input the score "),
Score =input.next.int(),
If (score >100),
{Grade="invalid score "}
Else if (score >74),
{Grade="A"}
If (score>69),
{Grade ="AB"}
If (score >64),
Else
{Grade ="negative value "}
System.out.println("The grade is "+ Grade ),
}
}


pc ads bottom

SHARE THIS

Author:

Previous Post
Next Post