Print Friendly and PDF

Program:

import java.util.Scanner;
class LetterGrade
{
public static void main (String args[])
{
int grade;
Scanner read=new Scanner(System.in);
System.out.print("Enter your grade: ");
grade=read.nextInt();
if(grade>=90)
System.out.print("Letter Grade: A");
else 
if(grade>=80)
System.out.print("Letter Grade: B");
else 
if(grade>=70)
System.out.print("Letter Grade: C"); 
else
 if(grade>=60)
System.out.print("Letter Grade: D");
else 
System.out.print("Letter Grade: F"); 
}
}
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: