Menu

Read three subject marks of a student and perform the following.

Read three subject marks of a student and perform the following.

a) Display the total marks scored
b) Display the average of marks
c) Display the grade and Remarks as per the following criteria
MARKS                  GRADE                    REMARKS
>=80                      A                             Excellent
>=70                      B                              Very Good
>=60                      C                              Good
>=50                       D                             Satisfactory
<50                        E                              Failure, Try Again!!!
import java.util.*;
class Student_grades_m1{
public static void main(String args[]){
System.out.println("Please enter the three subjects marks");
Scanner sc= new Scanner(System.in);
int sub1= sc.nextInt();
int sub2=sc.nextInt();
int sub3=sc.nextInt();
int total= (sub1+sub2+sub3);
float average = (float)total/3;
System.out.println("Total Marks "+total);
System.out.println("Average  "+average);
String grade;
if(average>=80)   grade="Excellent";
else if(average>=70)           grade="very good";
else if(average>=60)           grade="good";
else if(average>=50)   grade="Satisfactory";
else                                         grade="failure, try again!!!";

System.out.println("Remarks: "+grade);  }}