-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
227 lines (159 loc) · 7.13 KB
/
Main.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
import java.util.Scanner;
class Main {
public static void main(String[] args) {
while(true){
System.out.println("\n==================== \nMenu \n==================== \n1. Unit 1 FRQs \n2. Unit 2 FRQs \n3. Unit 3 FRQs\n4. Unit 4 FRQs\n5. Unit 5 FRQs\n6. Unit 6 FRQs\n====================");
Scanner scan = new Scanner(System.in);
System.out.println("Enter the AP Unit");
String unit = scan.nextLine();
if(unit.equals("2")){
System.out.println("Enter a light sequence of 0s and 1s");
String user_sequence = scan.nextLine();
LightSequence ls = new LightSequence(user_sequence);
System.out.println("\n==================== \n For your Light Sequence, chose an action \n==================== \n1. Display the sequence \n2. Update the sequence \n3. Insert a segment\n4. Remove segments from oldSeq\n5.find distance between two points\n====================");
String action = scan.nextLine();
if(action.equals("1")){
ls.display();
}
if(action.equals("2")){
System.out.println("Enter new light sequence");
ls.changeSequence(scan.nextLine());
System.out.print("New sequence is ");
ls.display();
}
if(action.equals("3")){
System.out.println("Enter sequence to insert");
String insert = scan.nextLine();
System.out.println("Now enter the index for inserting");
int index = Integer.parseInt(scan.nextLine());
ls.insertSegment(insert, index);
System.out.print("New sequence is ");
ls.display();
}
if(action.equals("4")){
System.out.println("Enter a sequence");
String old = scan.nextLine();
System.out.println("enter a segment to remove:");
String remove = scan.nextLine();
System.out.println("newSeq is " + ls.remover(old, remove));
}
if(action.equals("5")){
System.out.println("Enter first double ");
double a = Double.parseDouble(scan.nextLine());
System.out.println("Enter second double ");
double b = Double.parseDouble(scan.nextLine());
System.out.print("Distance is ");
ls.distance(a, b);
}
}
if(unit.equals("3")){
System.out.println("Enter Question Number");
String problem = scan.nextLine();
if(problem.equals("1")){
System.out.println("Will you be attending? Enter true/false");
boolean response = Boolean.parseBoolean(scan.nextLine());
System.out.println("Now enter your meal selection, 1-4:");
int choice = Integer.parseInt(scan.nextLine());
Unit_3_1 food = new Unit_3_1(response, choice);
food.message();
System.out.println(food.option1);
}
if(problem.equals("2")){
System.out.println("Enter a square side length:");
int l = Integer.parseInt(scan.nextLine());
Unit_3_2.drawSquare(5, 5, l);
}
}
if (unit.equals("4")){
System.out.println("Enter Question Number");
String problem = scan.nextLine();
if (problem.equals("1")){
System.out.println("Enter a string to find its longest streak of consecutive letters");
String string_input = scan.nextLine();
Unit_4_1.longestStreak(string_input);
}
if (problem.equals("2")){
System.out.println("We will be playing the coin game. Enter a starting number of coins");
int coins = Integer.parseInt(scan.nextLine());
System.out.println("Now input a max number of rounds");
int rounds = Integer.parseInt(scan.nextLine());
CoinGame game = new CoinGame(coins, rounds);
game.playGame();
}
}
if(unit.equals("5")){
System.out.println("Enter Question Number");
String problem = scan.nextLine();
if (problem.equals("1")){
System.out.println("Do you know the host name? YES or NO:");
String response = scan.nextLine();
if (response.equals("YES")){
System.out.println("Enter a host name:");
String user_name = scan.nextLine();
Invitation inv = new Invitation(user_name, "address");
System.out.println("Enter an address to update the default:");
String user_address = scan.nextLine();
inv.updateaddress(user_address);
System.out.println("What is your name?");
String user = scan.nextLine();
System.out.println(inv.invite(user));
}
else{
System.out.println("Enter the address:");
String user_address = scan.nextLine();
Invitation inv2 = new Invitation(user_address);
System.out.println("What is your name?");
String user = scan.nextLine();
System.out.println(inv2.invite(user));
}
}
if (problem.equals("2")){
System.out.println("This is the password generator. Enter the number of random digits you would like:");
int digit_response = Integer.parseInt(scan.nextLine());
System.out.println("Would you like a custom prefix? Type YES or NO:");
String prefix_response = scan.nextLine();
if(prefix_response.equals("YES")){
System.out.println("Enter your custom prefix:");
String user_prefix = scan.nextLine();
PasswordGenerator pwd = new PasswordGenerator(digit_response, user_prefix);
System.out.println("Generated password: " + pwd.pwGen() + " , total passwords generated: " + pwd.pwCount());
}
else{
PasswordGenerator pwd = new PasswordGenerator(digit_response);
System.out.println("Generated password: " + pwd.pwGen() + " , total passwords generated: " + pwd.pwCount());
}
}
}
if(unit.equals("6")){
System.out.println("Enter Question Number");
String problem = scan.nextLine();
if (problem.equals("1")){
System.out.println("Please enter a list of words, separated by commas:");
String response = scan.nextLine();
String[] word_list = response.split("\\s*,\\s*");
System.out.println("Here are the words ending in ing:");
Unit_6_1.filter(word_list);
}
if(problem.equals("2")){
System.out.println("Enter a list of itemsSold by each employee separated by commas:");
String response = scan.nextLine();
String[] items_sold_str = response.split("\\s*,\\s*");
int[] items_sold = new int[items_sold_str.length];
for(int i = 0;i < items_sold.length;i++){
items_sold[i] = Integer.parseInt(items_sold_str[i]);
}
Payroll pr = new Payroll(items_sold);
System.out.println("Enter a starting wage:");
double fixed_wage = Double.parseDouble(scan.nextLine());
System.out.println("Enter a per item wage:");
double per_item_wage = Double.parseDouble(scan.nextLine());
pr.computeWages(fixed_wage, per_item_wage);
System.out.println("Here are the final employee wages, in the same order:");
pr.printwages();
}
}
if(unit.equals("7")){
}
}
}
}