-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorldGeoInteract.java
More file actions
70 lines (63 loc) · 2.4 KB
/
WorldGeoInteract.java
File metadata and controls
70 lines (63 loc) · 2.4 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// --== CS400 File Header Information ==--
// Name: <Haoxuan Lu>
// Email: <hlu224@wisc.edu email address>
// Team: <EB>
// Role: <Front End Developer>
// TA: <Keren Chen>
// Lecturer: <Florian Heimerl>
// Notes to Grader: <optional extra notes>
import java.util.Scanner;
/**
* This is the WorldGeoInteract class used to achieve the human-computer interaction
*
* @author Haoxuan Lu
*
*/
public class WorldGeoInteract {
public static void main(String args[]) {
System.out.println("Welcome to the World Geological Map.");
Scanner sc = new Scanner(System.in);
System.out.println("What you want to do?\n1. (V)iew the current map\n2. (I)nsert new country"
+ "\n3. (R)emove a country\n4. (G)et the information of a country\n5. (E)xit");
String input = sc.nextLine().substring(0, 1).toUpperCase();
while (true) {
if (input.equals("V")) {
printMap();
} else if (input.equals("I")) {
System.out.println("What is the name for the country");
String name = sc.nextLine().strip().toLowerCase();
name = name.substring(0, 1).toUpperCase() + name.substring(1);
System.out.println("Any description to the country?");
String desc = sc.nextLine().strip().toLowerCase();
} else if (input.equals("R")) {
System.out.println("Which country you want to remove?");
String country = sc.nextLine().strip().toLowerCase();
country = country.substring(0, 1).toUpperCase() + country.substring(1);
Remove(country);
} else if (input.equals("G")) {
System.out.println("What the information you want to get?");
String inf = sc.nextLine().substring(0, 1).toUpperCase();
} else if (input.equals("E")) {
System.out.println("Thanks for using the World Geological Map. Bye-bye!");
break;
} else {
System.out.println("Sorry there is no such option.");
input = sc.nextLine().substring(0, 1).toUpperCase();
}
}
}
/**
* This is a private remove method used to remove country from the World Geological Map
*
* @param country
*/
private static void Remove(String country) {
// TODO Auto-generated method stub
}
/**
* This is a private method used to print all the city from the World Geological Map
*/
private static void printMap() {
// TODO Auto-generated method stub
}
}