-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserInterface
38 lines (30 loc) · 1.14 KB
/
UserInterface
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
import java.io.*;
import java.util.*;
public class UserInterface {
public static void main(String[] args) throws FileNotFoundException{
// What engineering major are you interested in?
Scanner console = new Scanner(System.in);
System.out.print("What engineering major are you interested in? ");
MajorNode major = new MajorNode(console.nextLine());
System.out.println();
// Print out list of prereqs for that major
System.out.println(major);
// Which of these classes have you taken? (Enter if none)
boolean hasClass = true;
while(hasClass){
System.out.print("Which of these classes have you already taken (enter if none)? ");
String taken = console.nextLine();
if(taken.equals("")){
hasClass = false;
} else {
major.remove(taken);
}
}
System.out.println();
// Print out uspdated list of classes needed to take
System.out.println(major);
// Here's a suggested schedule
System.out.println("Here's a Suggested Schedule: ");
major.makeSchedule();
}
}