-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathYeos.java
More file actions
21 lines (20 loc) · 807 Bytes
/
Yeos.java
File metadata and controls
21 lines (20 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Scanner;
public class Yeos {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String greeting = "Hello! I'm Yeos, your personal chatbot!\n"
+ "What can I do for you today?\n";
String bye = "Bye. Hope to see you again soon!\n";
String line = "_____________________________________________________________________\n";
System.out.println(line + greeting + line);
while(true) {
String input = scanner.nextLine();
if (input.equals("bye")) { // Check if the input is "bye"
System.out.println(line + bye + line);
break;
}
System.out.println(line + input + "\n" + line);
}
scanner.close();
}
}