-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAverageMark.java
More file actions
24 lines (22 loc) · 976 Bytes
/
AverageMark.java
File metadata and controls
24 lines (22 loc) · 976 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
// Find Average of 5 Subject out of 100 marks per Subject:
import java.util.Scanner;
public class AverageMark{
public static void main(String[]args){
Scanner scn = new Scanner(System.in);
System.out.println("Your Marks From 100!");
System.out.println("Enter your Maths marks:"); //1
float maths = scn.nextFloat();
System.out.println("Enter your English marks:"); //2
float english = scn.nextFloat();
System.out.println("Enter your Science marks:"); //3
float science = scn.nextFloat();
System.out.println("Enter your Hindi marks:"); //4
float hindi = scn.nextFloat();
System.out.println("Enter your Social Science marks:"); //5
float socialScience = scn.nextFloat();
float totalmarks = maths + english + science + hindi + socialScience;
float percentage = totalmarks/500*100;
System.out.println("Your total marks is:"+totalmarks);
System.out.println("Your percentage from your total marks is:"+percentage);
}
}