-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise22.java
More file actions
23 lines (21 loc) · 830 Bytes
/
Exercise22.java
File metadata and controls
23 lines (21 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
enum Currency{
NAIRA, DOLLAR, POUNDS, YEN, EURO, KUWAIT
}
public class Exercise22 {
static void describe(Currency currency){
switch(currency){
case NAIRA: System.out.println("currency for Nigeria"); break;
case DOLLAR: System.out.println("currency for US"); break;
case POUNDS: System.out.println("currency for UK"); break;
case YEN: System.out.println("currency for Japan"); break;
case EURO: System.out.println("currency for Europe"); break;
case KUWAIT: System.out.println("currency for Kuwait"); break;
default: System.out.println("Invalid currency");
}
}
public static void main(String[] args){
describe(Currency.DOLLAR);
describe(Currency.NAIRA);
describe(Currency.KUWAIT);
}
}