forked from Annex5061/java-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmarksToPercent.java
27 lines (25 loc) · 1.04 KB
/
marksToPercent.java
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
import java.util.Scanner;
public class marksToPercent {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter marks of hindi");
float marks1 = sc.nextFloat();
System.out.println("Enter marks of english");
float marks2 = sc.nextFloat();
System.out.println("Enter marks of mathematics");
float marks3 = sc.nextFloat();
System.out.println("Enter marks of science");
float marks4 = sc.nextFloat();
System.out.println("Enter marks of SST");
float marks5 = sc.nextFloat();
float total = marks1 + marks2 + marks3 + marks4 + marks5;
System.out.println("Total marks = ");
System.out.println(total);
float average = (total / 5.0f);
System.out.println("Average marks = ");
System.out.println(average);
float percentage = (total / 500.0f) * 100;
System.out.print("Percentage = " + percentage);
System.out.println(percentage);
}
}