-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControlPanel.pde
More file actions
45 lines (39 loc) · 961 Bytes
/
ControlPanel.pde
File metadata and controls
45 lines (39 loc) · 961 Bytes
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
class ControlPanel {
float profit;
ControlPanel() {
profit=0;
}
void TimeElapsed(Date time) {
if (time.minute==59)
hours++;
}
void drawPanel() {
fill (#AAAAAA);
rect(20, 10, 270, 70);
fill(0);
textSize(20);
text ("Parking rates:", 30, 30);
if (time.today<6) {
fill(#00DE01);
}
textSize(10);
text ("$3.00/ Hour"+ " Mon-Sat " + " 8 AM-6 PM ", 30, 45);
fill(0);
if (time.today==6) {
fill(#00DE01);
}
text ("1.50/Hour" + " Sunday" + " 8 AM-6 PM ", 30, 60);
fill (#AAAAAA);
rect (720, 10, 230, 90);
fill(0);
textSize(20);
text ("Simulation Values:", 730, 30);
textSize(10);
text ("Profit" + " = " +" $" + profit+ "0", 730, 45);
text ("Hours Elapsed" + " = " + hours + " Hours", 730, 60);
text ("Customers" + " =" + customers, 730, 75);
textSize(20);
fill(255);
text (time.toString(), 420, 45);
}
}