Skip to content

Commit 1539954

Browse files
Exercise 1 Solution
1 parent 6464983 commit 1539954

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import java.util.Scanner;
2+
3+
public class MyClass {
4+
public static void main(String args[]) {
5+
Scanner sc = new Scanner(System.in);
6+
int a, b, c, d, e;
7+
float result, percentage;
8+
System.out.println("Enter your marks respectively");
9+
10+
System.out.println("Enter your marks in Hindi Subject");
11+
a = sc.nextInt();
12+
13+
System.out.println("Enter your marks in English Subject");
14+
b = sc.nextInt();
15+
16+
System.out.println("Enter your marks in Math Subject");
17+
c = sc.nextInt();
18+
19+
System.out.println("Enter your marks in Physics Subject");
20+
d = sc.nextInt();
21+
22+
System.out.println("Enter your marks in Chemistry Subject");
23+
e = sc.nextInt();
24+
25+
result = a + b + c + d + e;
26+
percentage = (result/500) * 100;
27+
28+
System.out.println("Your percentage is " + percentage);
29+
}
30+
}

0 commit comments

Comments
 (0)