-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx01_PercentageCal.java
More file actions
34 lines (24 loc) · 927 Bytes
/
Ex01_PercentageCal.java
File metadata and controls
34 lines (24 loc) · 927 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
30
31
32
33
34
package com.company;
import java.util.Scanner;
public class Ex01_PercentageCal {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner (System.in);
System.out.println("Enter Student Name");
String Name = sc.next();
System.out.println("Marks in Maths");
int Maths = sc.nextInt();
System.out.println("Makrs in English");
int English = sc.nextInt();
System.out.println("Marks in Physics");
int Physics = sc.nextInt();
System.out.println("Marks in Chemestry");
int Chemestry = sc.nextInt();
System.out.println("Marks IN Hindi");
int Hindi = sc.nextInt();
int Total = Maths + English + Physics + Chemestry + Hindi;
float Persentage = (float) Total / 5;
System.out.println("Total Persentage of :" + Name);
System.out.println(Persentage);
}
}