-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontinentsCities.java
More file actions
29 lines (24 loc) · 844 Bytes
/
continentsCities.java
File metadata and controls
29 lines (24 loc) · 844 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
//Create a switch statement that will print out a continent and the
largest city in that continent
public class Continents {
public static void main(String[] args) {
int continent = 4;
switch(continent) {
case 1: System.out.println("North America: Mexico City, Mexico");
break;
case 2: System.out.println("South America: Sao Paulo, Brazil");
break;
case 3: System.out.println("Europe: Moscow, Russia");
break;
case 4: System.out.println("Africa: Lagos, Nigeria");
break;
case 5: System.out.println("Asia: Shanghai, China");
break;
case 6: System.out.println("Australia: Sydney, Australia");
break;
case 7: System.out.println("Antarctica: McMurdo Station, US");
break;
default:System.out.println("Undefined continent!");
}
}
}