Problem:- java program for student mark list using an array or simple java program for student details or java program for student mark sheet or java program for student mark list using inheritance or java program calculate student grades or java program for student mark sheet or calculate percentage in java example simple java program for student details or java program calculate student grades or student mark list program in java or mark sheet generation project in java with source code or java program for student mark list using inheritance or java program to find the grade of a student using if else or Java Program For Calculate Total Marks Of 5 Subjects And percentage.
Logic:- First we will ask the user for the total number of the subject after that we will enter marks of all those subjects. Now we will calculate a percentage of marks and print student marks, percentage, and Grade of Student. Percentage formula is given Below.
Percentage of Marks = (all subject marks sum) / Total Subject *100.
Explanation:- For this problem, I am taking 5 subjects. Now the first user has to enter a number of the subject of a student after that enter all subject marks and store the marks in an array. Now next step to add or find a sum of all subjects marks entered by the user and apply the formula and print the output calculated by the formula given.
System.out.print("Enter The 5 Subject Marks : ");
for(i=0; i<5; i++)
{
marks[i] = sc.nextInt();
sum = sum + marks[i];
}
System.out.print("\nStudent Percentage is = " +per+ "%\n\n");
Example:- Now take an example and check the output step by step. let's take 5 subjects in a semester and we have to calculate percentage out of total number 5 * 100 = 600.
Enter number of subjects: 5
Enter The Marks: 78 65 56 89 90
Percentage of a student: 75.6
Output:
Enter The 5 Subject Marks : 98
87
76
65
54
Student percentage is = 76.0%
need an explanation for this answer? contact us directly to get an explanation for this answer