-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradeMarks.java
More file actions
30 lines (23 loc) · 1012 Bytes
/
GradeMarks.java
File metadata and controls
30 lines (23 loc) · 1012 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
import java.util.Scanner;
public class GradeMarks{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter total Marks : ");
double TotalMarks = input.nextDouble();
System.out.print("Enter Obtain Marks : ");
double ObtainMarks = input.nextDouble();
double Percentage = ((ObtainMarks / TotalMarks) * 100);
if (Percentage >= 90) {
System.out.println("Marks Equal or Above 90%");
}else if (Percentage >= 75 && Percentage < 90) {
System.out.println("Marks Equal or Above 75%");
}else if (Percentage >= 60 && Percentage < 75){
System.out.println("Marks Equal or Above 60%");
}else if (Percentage >= 30 && Percentage < 60){
System.out.println("Marks Equal or Above 30%");
}else{
System.out.println("You are fail");
}
System.out.print("Marks Percentage is : " + Percentage + "%");
}
}