Write a program to determine if the given grade is within the range of 1.00 to 5.00
import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter the grade: ");
double grade = in.nextDouble();
if (grade >= 1.00 && grade <= 5.00) {
System.out.println("The given grade is within the range of 1.00 to 5.00");
} else {
System.out.println("The given grade is out the range of 1.00 to 5.00");
}
in.close();
}
}
Comments
Leave a comment