File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -33,30 +33,34 @@ private void runCalendar() {
33
33
System .out .println ("Bye bye" );
34
34
break ;
35
35
} else if (input .equals ("flashcard" )) {
36
+ System .out .println (" Switched to flashcard functions" );
36
37
runFlashcard ();
37
38
} else if (manager .validCommand (input )) {
38
39
manager .startCalendar (input );
39
40
} else {
40
41
System .out .println ("Invalid command! Enter a valid command." );
41
42
}
42
-
43
43
}
44
-
45
44
}
46
45
47
46
private void runFlashcard () {
48
- System .out .print ("Enter your command: " );
49
-
50
47
FlashcardComponent fc = new FlashcardComponent (new ArrayList <Flashcard >());
51
48
52
49
Scanner scanner = new Scanner (System .in );
53
50
String input ;
54
51
boolean shouldTerminate = false ;
55
52
53
+ System .out .print ("Enter your command: " );
56
54
while (!shouldTerminate ) {
57
55
input = scanner .nextLine ();
58
56
59
- if (fc .isResponsible (input )) {
57
+ if (input .equals ("end program" )) {
58
+ System .out .println ("Bye bye" );
59
+ break ;
60
+ } else if (input .equals ("calendar" )) {
61
+ System .out .println (" Switched to calendar functions" );
62
+ runCalendar ();
63
+ } else if (fc .isResponsible (input )) {
60
64
fc .processInput (input );
61
65
} else {
62
66
System .out .println (" Invalid command! Sorry; please try again." );
You can’t perform that action at this time.
0 commit comments