-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise1.java
More file actions
26 lines (25 loc) · 1.05 KB
/
Exercise1.java
File metadata and controls
26 lines (25 loc) · 1.05 KB
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
package com.company;
import java.util.Scanner;
public class Exercise1 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("Welcome to marks calculator");
System.out.print("Please tell your marks out of 100 in maths : ");
float maths = sc.nextFloat();
System.out.println("");
System.out.print("Please tell your marks out of 100 in science : ");
float science = sc.nextFloat();
System.out.println("");
System.out.print("Please tell your marks out of 100 in English : ");
float English = sc.nextFloat();
System.out.println("");
System.out.print("Please tell your marks out of 100 in Hindi : ");
float Hindi = sc.nextFloat();
System.out.println("");
System.out.print("Please tell your marks out of 100 in sst : ");
float sst = sc.nextFloat();
System.out.println("");
float percentage = (((maths+science+sst+English+Hindi)*100)/500);
System.out.println(percentage);
}
}