-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloSally.java
108 lines (81 loc) · 4.95 KB
/
HelloSally.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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import java.util.*;
public class HelloSally {
public static void main(String[] args) {
// take in input from the user
Scanner userInput = new Scanner(System.in);
System.out.println("type 'hello sally' to begin.");
String startCommand = userInput.nextLine().toLowerCase();
// error handling
while(!startCommand.equals("hello sally")) {
System.out.println("...try again dudski.");
startCommand = userInput.nextLine();
}
System.out.println();
System.out.println("Hello! How are you?");
boolean cont = true;
// array list that stores the list of activities
ArrayList<String> activities = new ArrayList<String>(
Arrays.asList(
"Plant an herb garden. Help the environment, be healthy and have a cute garden! \n (tip: basil smells and tastes great)",
"Buy some fake nails and glue them on and spend the day decorating them, you can never be too stylish ;)",
"Bake something good! Here are some examples:\n 1) macarons (yes there is a difference between macarons and macaroons) \n 2) chocolate chip cookies, \n 3) japanese milk bread! \n have any more examples? Submit your recipes to: [email protected]",
"Rent a bike and ride around central park. weeee!",
"Try to replicate some famous painting with some crayola paints",
"Watch Hanse on youtube. Ahh so satisfying (>^-^)>~~~",
"Get into a kpop band. Be careful because once you get sucked in, you can't come back out. See you on the darkside",
"Cook some cool food! Here are some examples: \n 1) Vietnamese Pho \n 2) fries and steak with garlic sauce \n 3) the blood of your enemies! \nSubmit some more examples/recipes to: [email protected]",
"Get into some comic book series. DC? Marvel? the choice is yours. Choose wisely",
"Learn to play the ukelele like any other tween superstar!",
"Watch a documentary on the Vietnam war and appreciate the people that serve this country",
"Watch animal planet or any other documentary about the world for that matter",
"Hatch a quail from the supermarket! \nI was a skeptic too at first but then my first child Charlie the quail was born \nR.I.P Charlie June 5th, 2018 ~ August 20th, 2018",
"Watch speedpaint videos on youtube and be amazed by how untalented you are (jk,you're amazeballs",
"Learn a new language (pro tip: watch videos/shows in those languages)",
"Write a short story. Remember show it, don't tell it",
"Make a bucket list and be motivated to do them",
"befriend some deer ^-^ #deersquad",
"learn how to program lol.",
"solve global warming",
"watch the latest tween show (ex: Riverdale)",
"Stream the newest BTS song. do it, you know you want to",
"get a boyfriend or girlfriend. if you have one, get a friend :-)",
"get an education! learn some random skills from the internet",
"Write a Java Program lol"
));
System.out.println("if you are bored, type \'bored\'");
String userFeeling = userInput.nextLine().toLowerCase();
// error handling
while(!userFeeling.equals("bored")) {
System.out.println("I think you spelled bored wrong. try again.");
userFeeling = userInput.nextLine().toLowerCase();
}
if(userFeeling.equals("bored")) {
System.out.println();
System.out.println("Well-- I can help with that");
}
do {
System.out.println("Today you should try doing:");
// randomly select activity from the list using random instant
Random random = new Random();
int rand = random.nextInt(activities.size()-1);
String chosenAct = activities.get(rand);
System.out.println();
System.out.println(chosenAct);
// remove activity from list so that the user will be guranteed a different activity if they restart program
activities.remove(rand);
System.out.println();
// loop program
System.out.println("Would you like to restart? yes or no");
String contAnswer = userInput.nextLine();
// error handling
while(!contAnswer.equals("yes") && !contAnswer.equals("no")) {
System.out.println("that's not an answer try again.");
contAnswer = userInput.nextLine();
}
if(contAnswer.equals("no")) {
cont = false;
}
} while(cont == true);
System.out.println("bye bye!");
}
}