-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainExecutable.java
28 lines (26 loc) · 966 Bytes
/
MainExecutable.java
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
// The "Magpie" AP Lab is created for the College Board APCS
// curriculum by Laurie White.
// This program has been altered and expanded by members of the 2019-2020 FHS Computer Club.
// This the main executeable which will serve the chatbot by allowing it to greet the user, and say farewell.
// Other ideas will be placed in separate files and will be called using this executable.
import java.util.Scanner;
import java.util.ArrayList;
public class MainExecutable
{
public static void main(String[] args)
{
FHSChatBot panther = new FHSChatBot();
System.out.println (panther.getGreeting());
Scanner in = new Scanner (System.in);
String statement = in.nextLine();
statement = statement.toLowerCase();
while (!statement.equals("bye"))
{
System.out.println(panther.getResponse(statement, panther, in));
statement = in.nextLine().toLowerCase();
if( statement.equals("no") ) {
statement = "bye";
}
}
}
}