-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnestedChoice.java
More file actions
35 lines (27 loc) · 817 Bytes
/
nestedChoice.java
File metadata and controls
35 lines (27 loc) · 817 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
35
import java.util.Scanner;
class nestedChoice {
public static void main(String[] args) {
Scanner myIn = new Scanner(System.in);
System.out.println(" please enter your mark. ");
int mark = myIn.nextInt();
if (mark >= 40)
{
System.out.println("well done ");
System.out.println("you have passed");
}
else
{
System.out.println("were there any extenuating circumstances, Y/N ");
char circumstances = myIn.next().charAt(0);
if ( circumstances == 'Y' || circumstances == 'y')
{
System.out.println("this will be counted as a first diet exam");
System.out.println("hope everything is ok now and you will pass");
}
else
{
System.out.println("If there are no circumstances then this is a fail");
System.out.println("Good luck with the resit");
}
}
} }