Create a Grade application that prompts the user for the percentage earned on a test or other graded work and then displays the corresponding letter grade. The application should use the grading scale at your school or the following grading scale:
90 – 100 A
80 – 89 B
70 – 79 C
60 – 69 D
below 60 F
The application output should look similar to:
Enter your marks: 90
Grade: A
Notes: coded in java.
Please don't make it too complicated so don't use keyboard coding or anything of that sort.
Make it as simple as possible because I am in a grade 11 comp sci course and we just started.
Required code in java -->
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Percentage earned "); // Ask user for
percentage earned
int marks = sc.nextInt(); // read input from user and store the
value in marks
if(marks>=90 && marks<=100){ // if marks (90
-100)
System.out.println("Grade is : A"); // print A
}
else if(marks>=80 && marks<=89){ // if
marks(80-89)
System.out.println("Grade is : B"); // print B
}
else if(marks>=70 && marks<=79){ // if marks
70-79
System.out.println("Grade is : C"); // print C
}
else if(marks>=60 && marks<=69){ // if marks
60-69
System.out.println("Grade is : D"); // print D
}
else{ // else
System.out.println("Grade is : F"); // print F
}
}
}
Get Answers For Free
Most questions answered within 1 hours.