-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBoxFactory2018Main.py
65 lines (53 loc) · 11.8 KB
/
BoxFactory2018Main.py
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
from com.prestonsproductions.sourcecode.BoxFactory2018 import BoxFactory2018 as BF
def main():
# Boxes Surface Area
boxesSF = [712,349,756,349,343,114,234,215,635,284,772,783,377,392,871,771,442,744,946,223,416,404,710,956,275,378,
745,688,676,373,733,884,365,678,954,329,804,550,404,218,514,138,927,542,248,968,340,728,520,301,377,785,
403,223,488,114,110,450,779,176,672,278,706,385,873,238,843,156,340,250,934,286,872,185,258,454,183,790,
522,325,348,633,888,263,503,830,311,595,654,195,581,148,427,193,986,583,324,822,258,538]
# Boxes
boxes = [(1,16,27),(36,3,7),(9,15,31),(8,11,27),(17,15,6),(1,36,7),(12,41,42),(11,38,6),(27,38,3),(6,14,18),(19,37,10),
(21,34,18),(5,14,3),(23,11,21),(41,35,38),(10,12,29),(37,12,19),(35,21,28),(19,5,28),(17,18,24),(42,16,20),
(27,15,3),(38,1,9),(6,29,5),(10,29,20),(14,14,34),(9,1,1),(3,16,37),(38,41,29),(42,9,35),(2,20,28),(20,42,7),
(2,36,28),(2,11,6),(11,24,26),(18,28,14),(5,5,23),(36,41,35),(12,4,19),(7,22,23),(15,22,3),(10,40,38),(25,30,18),
(11,10,30),(35,33,20),(26,1,22),(5,32,38),(41,2,5),(40,37,17),(15,17,8),(19,30,25),(20,36,10),(22,17,35),(34,14,35),
(20,8,9),(26,18,6),(38,8,39),(20,31,33),(33,39,20),(36,41,4),(3,38,13),(9,6,26),(5,15,24),(7,15,20),(25,2,6),(19,18,29),
(26,21,19),(16,40,31),(38,19,12),(37,4,28),(26,5,22),(10,33,33),(34,42,29),(31,7,23),(24,42,6),(39,35,8),(21,27,15),
(20,42,24),(34,39,13),(13,26,25),(7,13,13),(29,16,38),(14,38,19),(1,19,39),(9,9,15),(35,4,15),(10,41,23),(34,15,20),
(38,37,38),(26,42,33),(24,19,5),(14,31,37),(27,30,21),(12,35,37),(7,19,7),(19,1,22),(34,14,7),(38,14,33),(36,16,9)]
# Objects Volume
objects = [362,35,374,696,417,129,486,456,584,935,273,314,778,220,299,156,552,226,683,217,827,482,635,200,855,273,
745,750,387,793,707,337,974,147,130,586,312,585,635,949,217,315,843,420,209,279,156,527,357,249,681,505,
972,920,812,320,809,654,702,563,652,599,587,740,680,673,702,263,702,932,562,421,453,23,898,485,968,620,
792,205,179,92,362,2,89,600,18,514,75,110,976,872,458,44,642,411,437,539,233, 1000]
# Print Question Answer 112 Points Total
print('Source Code - Division B/C - Box Factory - Box Production')
print('QUESTION 0 OBJECTIVE A (2): '+str(BF.getBoxProductionTitle('The Source Code Box Production', '00022', '01/13/2019'))) # The Source Code Box Production : 00022 :01/13/2019
print('Question 1 OBJECTIVE A (2): '+str(BF.getVolume(10,20,5))) # 1000
print('Question 2 OBJECTIVE A (3): '+str(BF.getSurfaceArea(4,5,10))) # 220
print('Question 3 OBJECTIVE A (3): '+str(BF.isBoxLargeEnough(12, 11))) # True
print('Question 4 OBJECTIVE A (4): '+str(BF.getTotalSurfaceArea(boxesSF))) # 50613
print('Question 5 OBJECTIVE A (4): '+str(BF.getAverageSurfaceArea(boxesSF))) # 506.13
print('Question 6 OBJECTIVE A (4): '+str(BF.getSumOfFactors(boxesSF))) # 645
print('Question 7 OBJECTIVE A (4): '+str(BF.reverseList(objects))) # ['263', 35, '473', '696', '714', '921', '684', '654', '485', '539', '372', '413', '877', '022', '992', '651', '255', '622', '386', '712', '728', '284', '536', '002', '558', '372', '547', '057', '783', '397', '707', '733', '479', '741', '031', '685', '213', '585', '536', '949', '712', '513', '348', '024', '902', '972', '651', '725', '753', '942', '186', '505', '279', '029', '218', '023', '908', '456', '207', '365', '256', '995', '785', '047', '086', '376', '207', '362', '207', '239', '265', '124', '354', 23, '898', '584', '869', '026', '297', '502', '971', 92, '263', 2, 89, '006', 18, '415', 75, '011', '679', '278', '854', 44, '246', '114', '734', '935', '332', '0001']
print('Question 8 OBJECTIVE A (4): '+str(BF.getBoxBuildTime(10,20,30))) # 55.0
print('Question 8 OBJECTIVE B (2): '+str(BF.getBoxBuildTime(39,41,30))) # -1
print('Question 9 OBJECTIVE A (4): '+str(BF.getBoxCost(99, 0.24))) # 23.76
print('Question 9 OBJECTIVE B (2): '+str(BF.getBoxCost(100, 0.24))) # 19.0
print('Question 10 OBJECTIVE A (4): '+str(BF.getBoxAddOnCost(150, 'CARDBOARD', 8))) # 150.0
print('Question 10 OBJECTIVE B (4): '+str(BF.getBoxAddOnCost(150, 'PLASTIC', 11))) # 148.5
print('Question 10 OBJECTIVE C (4): '+str(BF.getBoxAddOnCost(150, 'METAL', 9))) # 180.9
print('Question 11 OBJECTIVE A (4): '+str(BF.getMaterialPercentage(boxesSF))) # (44.0, 49.0, 7.000000000000001) or (44, 49, 7)
print('Question 11 OBJECTIVE B (2): '+str(BF.getMaterialPercentage(boxesSF))) # (44, 49, 7)
print('Question 12 OBJECTIVE A (6): '+str(BF.getTotalBuildTime(boxes))) # 4926.35
print('Question 13 OBJECTIVE A (6): '+str(BF.getBoxes(objects))) # [(7.126935967201602, 7.126935967201602, 7.126935967201602), (3.2710663101885897, 3.2710663101885897, 3.2710663101885897), (7.20483214721452, 7.20483214721452, 7.20483214721452), (8.862095243387268, 8.862095243387268, 8.862095243387268), (7.470999115478001, 7.470999115478001, 7.470999115478001), (5.05277434720856, 5.05277434720856, 5.05277434720856), (7.862224182626689, 7.862224182626689, 7.862224182626689), (7.697002262553609, 7.697002262553609, 7.697002262553609), (8.358678392762462, 8.358678392762462, 8.358678392762462), (9.7784616525042, 9.7784616525042, 9.7784616525042), (6.48715411671635, 6.48715411671635, 6.48715411671635), (6.7968843858592365, 6.7968843858592365, 6.7968843858592365), (9.197289686814337, 9.197289686814337, 9.197289686814337), (6.036810736797685, 6.036810736797685, 6.036810736797685), (6.686883076988654, 6.686883076988654, 6.686883076988654), (5.383212612087283, 5.383212612087283, 5.383212612087283), (8.203131859404694, 8.203131859404694, 8.203131859404694), (6.091199348919784, 6.091199348919784, 6.091199348919784), (8.806572225338611, 8.806572225338611, 8.806572225338611), (6.009245006917366, 6.009245006917366, 6.009245006917366), (9.386460059516399, 9.386460059516399, 9.386460059516399), (7.840594845883629, 7.840594845883629, 7.840594845883629), (8.595238034338408, 8.595238034338408, 8.595238034338408), (5.848035476425731, 5.848035476425731, 5.848035476425731), (9.49121995802933, 9.49121995802933, 9.49121995802933), (6.48715411671635, 6.48715411671635, 6.48715411671635), (9.065367701259413, 9.065367701259413, 9.065367701259413), (9.085602964160698, 9.085602964160698, 9.085602964160698), (7.287361631121842, 7.287361631121842, 7.287361631121842), (9.25602237474319, 9.25602237474319, 9.25602237474319), (8.908538705945451, 8.908538705945451, 8.908538705945451), (6.958943337186094, 6.958943337186094, 6.958943337186094), (9.91257118112387, 9.91257118112387, 9.91257118112387), (5.277632087904077, 5.277632087904077, 5.277632087904077), (5.065797019100886, 5.065797019100886, 5.065797019100886), (8.368209391204644, 8.368209391204644, 8.368209391204644), (6.782422886028333, 6.782422886028333, 6.782422886028333), (8.363446607369195, 8.363446607369195, 8.363446607369195), (8.595238034338408, 8.595238034338408, 8.595238034338408), (9.827025224202185, 9.827025224202185, 9.827025224202185), (6.009245006917366, 6.009245006917366, 6.009245006917366), (6.804092115953367, 6.804092115953367, 6.804092115953367), (9.44660721966867, 9.44660721966867, 9.44660721966867), (7.488872387218507, 7.488872387218507, 7.488872387218507), (5.934472140399941, 5.934472140399941, 5.934472140399941), (6.534335077087572, 6.534335077087572, 6.534335077087572), (5.383212612087283, 5.383212612087283, 5.383212612087283), (8.077374240743945, 8.077374240743945, 8.077374240743945), (7.093970944750709, 7.093970944750709, 7.093970944750709), (6.291194551556287, 6.291194551556287, 6.291194551556287), (8.79796785031895, 8.79796785031895, 8.79796785031895), (7.963374241789242, 7.963374241789242, 7.963374241789242), (9.905781746683878, 9.905781746683878, 9.905781746683878), (9.725888262188558, 9.725888262188558, 9.725888262188558), (9.329363390985685, 9.329363390985685, 9.329363390985685), (6.839903786706787, 6.839903786706787, 6.839903786706787), (9.317859848626759, 9.317859848626759, 9.317859848626759), (8.68012373555622, 8.68012373555622, 8.68012373555622), (8.88748820522211, 8.88748820522211, 8.88748820522211), (8.257263269927625, 8.257263269927625, 8.257263269927625), (8.671266460286839, 8.671266460286839, 8.671266460286839), (8.429638310387759, 8.429638310387759, 8.429638310387759), (8.372966759705923, 8.372966759705923, 8.372966759705923), (9.045041696510273, 9.045041696510273, 9.045041696510273), (8.793659344316357, 8.793659344316357, 8.793659344316357), (8.763380887467774, 8.763380887467774, 8.763380887467774), (8.88748820522211, 8.88748820522211, 8.88748820522211), (6.4069585771855575, 6.4069585771855575, 6.4069585771855575), (8.88748820522211, 8.88748820522211, 8.88748820522211), (9.767992199474913, 9.767992199474913, 9.767992199474913), (8.252371525139433, 8.252371525139433, 8.252371525139433), (7.49481122585905, 7.49481122585905, 7.49481122585905), (7.680085719529357, 7.680085719529357, 7.680085719529357), (2.8438669798515654, 2.8438669798515654, 2.8438669798515654), (9.64773676867724, 9.64773676867724, 9.64773676867724), (7.856828007847996, 7.856828007847996, 7.856828007847996), (9.8921748864974, 9.8921748864974, 9.8921748864974), (8.527018983281597, 8.527018983281597, 8.527018983281597), (9.252130018365483, 9.252130018365483, 9.252130018365483), (5.896368539970366, 5.896368539970366, 5.896368539970366), (5.635740794544236, 5.635740794544236, 5.635740794544236), (4.514357435474001, 4.514357435474001, 4.514357435474001), (7.126935967201602, 7.126935967201602, 7.126935967201602), (1.2599210498948732, 1.2599210498948732, 1.2599210498948732), (4.464745095584537, 4.464745095584537, 4.464745095584537), (8.434326653017491, 8.434326653017491, 8.434326653017491), (2.6207413942088964, 2.6207413942088964, 2.6207413942088964), (8.01040313265657, 8.01040313265657, 8.01040313265657), (4.217163326508746, 4.217163326508746, 4.217163326508746), (4.791419857062784, 4.791419857062784, 4.791419857062784), (9.9193513276846, 9.9193513276846, 9.9193513276846), (9.553712362070033, 9.553712362070033, 9.553712362070033), (7.708238778159992, 7.708238778159992, 7.708238778159992), (3.530348335326063, 3.530348335326063, 3.530348335326063), (8.626706236691353, 8.626706236691353, 8.626706236691353), (7.434993741615868, 7.434993741615868, 7.434993741615868), (7.588579337781814, 7.588579337781814, 7.588579337781814), (8.138223044397701, 8.138223044397701, 8.138223044397701), (6.153449493663682, 6.153449493663682, 6.153449493663682), (9.999999999999998, 9.999999999999998, 9.999999999999998)]
print('Question 14 OBJECTIVE A (6): '+str(BF.needsPerfectSqaureSticker(64))) # True
print('Question 15 OBJECTIVE A (6): '+str(BF.getPythagoreanTriples(boxes))) # 3
print('Question 16 OBJECTIVE A (6): '+str(BF.isBoxesLargeEnough(boxesSF, objects))) # [True, True, True, False, True, False, False, False, True, False, True, True, False, True, True, True, True, True, True, True, False, True, True, True, False, True, True, True, True, False, True, True, False, True, True, False, True, True, False, False, True, False, True, True, True, True, True, True, True, True, False, True, False, False, False, False, False, False, True, False, True, False, True, False, True, False, True, False, False, False, True, False, True, True, False, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, True, True, True, True, False, True, True, False]
print('Question 17 OBJECTIVE A (8): '+str(BF.getMostBoxesCount(boxes, 10000))) # 16
print('Question 18 OBJECTIVE A (8): '+str(BF.getPrimeNumberBoxesVolume(50))) # 130660163
print('Question 19 OBJECTIVE A (4): '+str(BF.getStatistics(boxes)))
print('QUESTION 19 OBJECTIVE B (2): '+'Check for comment explaining function.')
print('QUESTION 19 OBJECTIVE C (2): '+'Check if previous function in file was called.')
print('QUESTION 19 OBJECTIVE D (2): '+'Check if import statement was used.')
main()