1) write a program in java to accept marks secured by a student in four subjects where 100 is full mark for each subject. then calculate his percentage mark and display his grade on the following basis. percentage mark grade 70% or above a 40% to 69% b below 40% c
Answers
Answer:
This program calculates the grade of a student based on the marks entered by user in each subject. Program prints the grade based on this logic.
If the average of marks is >= 80 then prints Grade ‘A’
If the average is <80 and >=60 then prints Grade ‘B’
If the average is <60 and >=40 then prints Grade ‘C’
else prints Grade ‘D’
To understand this Program you should have the knowledge of following concepts of Java:
Java For Loop
Arrays in Java
if..else-if in Java
The student Grade is: B
Explanation:
This program calculates the grade of a student based on the marks entered by user in each subject. Program prints the grade based on this logic.
If the average of marks is >= 80 then prints Grade ‘A’
If the average is <80 and >=60 then prints Grade ‘B’
If the average is <60 and >=40 then prints Grade ‘C’
else prints Grade ‘D’
To understand this Program you should have the knowledge of following concepts of Java:
Java For Loop
Arrays in Java
if..else-if in Java
Enter Marks of Subject1:40
Enter Marks of Subject2:80
Enter Marks of Subject3:80
Enter Marks of Subject4:40
Enter Marks of Subject5:60
Enter Marks of Subject6:60
The student Grade is: B