-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubjects_Marks.java
More file actions
29 lines (24 loc) · 998 Bytes
/
Subjects_Marks.java
File metadata and controls
29 lines (24 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.util.Scanner;
public class Subjects_Marks {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the max marks of each subject : ");
System.out.print("Enter 1st Subejct Marks : ");
float s1 = sc.nextFloat();
System.out.print("Enter 2st Subejct Marks : ");
float s2 = sc.nextFloat();
System.out.print("Enter 3st Subejct Marks : ");
float s3 = sc.nextFloat();
System.out.print("Enter 4st Subejct Marks : ");
float s4 = sc.nextFloat();
System.out.print("Enter 5st Subejct Marks : ");
float s5 = sc.nextFloat();
float total, average, percentage;
total = s1 + s2 + s3 + s4 + s5;
average = total / 5;
percentage = (total / 500) * 100;
System.out.print("total Marks = " + total);
System.out.print("\nAverage = " + average);
System.out.print("\nPercentage = " + percentage);
}
}