-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (24 loc) · 785 Bytes
/
Copy pathMain.java
File metadata and controls
30 lines (24 loc) · 785 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 Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = input.nextLine();
System.out.print("Enter your marks: ");
int marks = input.nextInt();
System.out.println("Student: " + name);
System.out.println("Marks: " + marks);
if (marks >= 75){
System.out.println("Result: Distinction");
}else if (marks >= 60){
System.out.println("Result: First Division");
}
else if (marks >= 40){
System.out.println("Result: Pass");
}
else{
System.out.println("Result: Fail");
}
input.close();
}
}