-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
42 lines (32 loc) · 1.31 KB
/
Main.java
File metadata and controls
42 lines (32 loc) · 1.31 KB
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
/** Read, organize and output customer orders
*
* Main Class
* @author Danny Guan
* @version 6
*/
public class Main
{
public static void main(String[] args)
{
int inputs = 3;
ReadFile scan = new ReadFile(inputs, 1);
// Reads input file (Values.txt)
String[][] stringArray = scan.ScanFile();
Lottery customerLottery = new Lottery();
CustomerInformation[] customers = new CustomerInformation[stringArray.length];
// Creates User objects with correct info
for (int y = 0; y < customers.length; y++){
customers[y] = new CustomerInformation(Integer.parseInt(stringArray[y][1]),Integer.parseInt(stringArray[y][2]), stringArray[y][0]);
}
customers = customerLottery.RandomizeOrder(customers);
// Outputs file to Output.txt
WriteFile output = new WriteFile();
output.OutputFile(customers);
// Prints out user information
System.out.println("Ticket Requests in randomized order....\n");
for (int x = 0; x < customers.length; x ++){
System.out.println(customers[x].toString() + "\n");
}
System.out.println("Refer to the Output.txt file to check the email text(s) generated, and if the request(s) could be fulfilled");
}
}