-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContinents.java
More file actions
30 lines (24 loc) · 873 Bytes
/
Continents.java
File metadata and controls
30 lines (24 loc) · 873 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
public class Continents {
public static void main(String[] args) {
//Prints out the continent details depending on the nuber input using a switch statement;
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( "Antartica: McMurdo Stn, US.");
break;
default: System.out.println( "Undefined Continent!");
break;
}
}
}