-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMark.java
More file actions
49 lines (44 loc) · 1.59 KB
/
Mark.java
File metadata and controls
49 lines (44 loc) · 1.59 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.Scanner;
public class Mark {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int choice;
int mark;
do{
System.out.println("Enter 1 to input Student marks, 0 to stop");
choice= sc.nextInt();
if (choice==1) {
do{
System.out.println("Enter the mark (0-100): ");
mark = sc.nextInt();
if (0 <= mark && mark <= 100 ) {
if ( mark >= 90) {
System.out.println("This is good");
}
else if(mark <= 89 && mark >=60)
{
System.out.println("This is also good");
}
else
{
System.out.println("This is good as well ");
System.out.println(" Because mark does not matter but our efforts does.");
}
}
else
{
System.out.println("Invalid mark. Please enter a value between 1-100.");
}
choice = sc.nextInt();
}while (choice==1);
}
else if (choice==0) {
System.out.println("Exit");
}
else{
System.out.println("Invalid choice. Please enter a value 0 or 1.");
}
}while(choice != 0);
sc.close();
}
}