Skip to content

Commit 7341e69

Browse files
committed
Added ThemePark2019 Test
1 parent db1cd2d commit 7341e69

File tree

5 files changed

+720
-0
lines changed

5 files changed

+720
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ com/prestonsproductions/sourcecode/MusicLibrary2018/Teams/*
1111

1212
com/prestonsproductions/sourcecode/RoadTrip2018/Teams/*
1313

14+
com/prestonsproductions/sourcecode/FantasyBaseball2018/Teams/*
15+
16+
com/prestonsproductions/sourcecode/ThemePark2019/Teams/*
17+
1418
=======
1519
# Byte-compiled / optimized / DLL files
1620
__pycache__/
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
# TEAM NAME:
2+
# TEAM NUMBER:
3+
# PARTICIPANT NAMES:
4+
5+
# SOURCE CODE
6+
# 2019 - Theme Park - Park Builder
7+
# DIVISION B/C
8+
9+
''' INSTRUCTIONS
10+
11+
SCENARIO: Theme Park - Park Builder
12+
DESCRIPTION: You have inherited a large piece of land, a large sum of money, and have decided to
13+
build a theme park! The functions below will simulate tasks and calculations needed to build the
14+
optimal park. Optimal meaning, generating the largest profit based on the size of your land,
15+
available funds, and list of rides and attractions you can build. Note: Sizes and values are not to scale.
16+
17+
1. For each question, write your code to solve each objective. (return the answer programmatically. ie via variables)
18+
2. Each objective is worth a designated number of points. 74 Points Total.
19+
3. Highest number of points wins. Question 15 is a tie breaker. If there is still a tie, question 14, 13 and so on will break the tie.
20+
4. The main function will call and run all of the question objectives and print the answers. Do not modify this function.
21+
5. Programs that do not run/compile will not be eligible to receive full points as determined by the Source Code rules.
22+
6. Run your program often to test and check for errors. View the main function to see what values are passed as parameters.
23+
24+
INFORMATION: Some questions will use a list of dictionaries. Each dictionary will represent a ride or attraction.
25+
The structure will be:
26+
[
27+
{
28+
'TYPE':'Roller Coaster', # Type of ride/attraction (String)
29+
'SUBTYPE':'Hyper Coaster', # SubType of the ride/attraction (String)
30+
'COST':2000, # Cost (in dollars) to build (Number)
31+
'SIZE':100, # Size (in Square Feet) required to build (Number)
32+
'CAPACITY':50, # How many park guests can use the ride/attraction per hour (Number)
33+
'PROFIT':5, # Profit (in dollars) per guest using the ride/attraction (Number)
34+
'FUNRATING':10 # A 'fun' rating where 1 is the lowest and 10 is highest. (Number)
35+
},
36+
...
37+
]
38+
39+
GOOD LUCK! '''
40+
41+
# QUESTION 0: THEME PARK NAME
42+
# OBJECTIVE A (2): Create a name for your theme park which includes your team name
43+
# and number and return the name from this function.
44+
# ex) Bath High School 7 Wonderland
45+
def getThemeParkName():
46+
47+
return ''
48+
49+
# QUESTION 1: RIDE DESCRIPTION
50+
# OBJECTIVE A (2): Three parameters are passed into the function below.
51+
# A String, String, and Number (rideType, name, funrating). Append the string together to return
52+
# the ride description. ex) Roller Coaster - The Screaming Eagle - 10
53+
def getRideDescription(rideType, name, funRating):
54+
55+
return ''
56+
57+
# QUESTION 2: RIDE PRICE
58+
# OBJECTIVE A (2): The total capacity (capacity) per hour and total
59+
# profit (profit) per hour are passed into the function below. Calculate and return
60+
# the price for one ride.
61+
# OBJECTIVE B (2): Format the result into the following format: $0.00.
62+
# Rounded to the nearest hundredth.
63+
def getRidePrice(capacity, profit):
64+
65+
return ''
66+
67+
# QUESTION 3: DOES IT FIT?
68+
# OBJECTIVE A (3): The function below has two parameters representing the
69+
# total area (totalArea) and the area used (areaUsed). Determine if the
70+
# total area is still greater than the area used. If the total area is greater
71+
# than the area used, return the difference between totalArea and areaUsed,
72+
# otherwise return -1
73+
def isFit(totalArea, areaUsed):
74+
75+
return ''
76+
77+
# QUESTION 4: RIDES AND ATTRACTION COUNT
78+
# OBJECTIVE A (3): A list of dictionaries (attractions) representing the rides
79+
# and attractions data, as described above, is passed into the function below.
80+
# count how many items are in the list and return the number.
81+
def getAttractionsCount(attractions):
82+
83+
return ''
84+
85+
# QUESTION 5: RIDES AND ATTRACTION COUNT ORGANIZED
86+
# OBJECTIVE A (4): Again, the list of attractions is passed into the function
87+
# below. Count how many attractions of each TYPE there are, and return the counts
88+
# in a dictionary. ex): {'Roller Coaster':2, 'Thrill Ride':2...}
89+
def getAttractionsCountOrganized(attractions):
90+
91+
return ''
92+
93+
# QUESTION 6: RIDE COST
94+
# OBJECTIVE A (4): The list of attractions is passed into the function below as well as
95+
# a subtype for a ride. Find the ride in the list and return the cost to build that ride.
96+
# If the ride is not found, return 0
97+
def getRideCost(subtype, attractions):
98+
99+
return ''
100+
101+
# QUESTION 7: FUN RATING PERCENTAGE
102+
# OBJECTIVE A (4): The list of attractions is passed in to the function below.
103+
# What percentage of the attractions have a FUNRATING greater than 5. Do not count
104+
# TYPEs of 'SHOP' in the calculations. Return the percentage.
105+
# OBJECTIVE B (2): Round the percentage to the nearest hundredth, and return
106+
# the value formated like: 76%
107+
def getFunPercentage(attractions):
108+
109+
return ''
110+
111+
# QUESTION 8: PROFIT VS COST
112+
# OBJECTIVE A (5): Before your theme park is open, you want to determine what the best ride to
113+
# build is. That is, which ride has the highest profit to cost ratio. (profit divided by cost).
114+
# Return the SUBTYPE, or SUBTYPEs of the attractions in a list. The list of attractions is passed
115+
# into the function below.
116+
def getProfitCostRatio(attractions):
117+
118+
return ''
119+
120+
# QUESTION 9: FUN RATING 8 ANALYSIS
121+
# OBJECTIVE A (5): If you were to build all rides and attractions with a FUNRATING of 8
122+
# (just once), and your park is open for 12 hours, what is the profit you would earn for
123+
# one day. Use the list of attractions passed in to the function and return the total.
124+
def getFunRating8Profit(attractions):
125+
126+
return ''
127+
128+
# QUESTION 10: REMAINING PROFIT
129+
# OBJECTIVE A (5): Using the datetime library. The profit per hour for a ride
130+
# is passed into the function below (profitPerHour). Closing time is 10:00PM. If the current
131+
# time is between 10:00AM and 10:00PM, determine and return how much profit will be earned for
132+
# the ride between now and closing time. Otherwise return 0. Do not round. Only consider hours and minutes.
133+
def getRemainingProfit(profitPerHour):
134+
135+
return ''
136+
137+
# QUESTION 11: MAX RIDES WITH FUNDS
138+
# OBJECTIVE A (6): Given the list of rides and attractions (attractions) and a sum of money (funds)
139+
# determine the maximum numbers of attractions you can build (without building any attraction twice).
140+
# Return the number of rides/attractions. HINT: Make a new function to sort the attractions.
141+
def getMaxNumberOfRides(attractions, funds):
142+
143+
return ''
144+
145+
# QUESTION 12: AVG FUN RATING RIDES
146+
# OBJECTIVE A (6): Given the list of rides and attractions (attractions), determine the average fun rating.
147+
# Rounded to the nearest Integer. Do not consider TYPE of 'Shop'. Then find the rides with
148+
# that fun rating and count the number of letters in their SUBTYPE field. Return the total
149+
# count of all the letters.
150+
def getAvgFunCharacters(attractions):
151+
152+
return ''
153+
154+
# QUESTION 13: I'M A THRILL RIDER
155+
# OBJECTIVE A (6): A tourist goes to your theme park where you have only built rides
156+
# of TYPE 'Thrill Ride'. The full list of attractions is passed into
157+
# the function below, along with an amount of money (money) the tourist
158+
# brings to the park. Determine and return the maximum number of thrill rides they can
159+
# ride with their money. The tourist must ride each ride once, before they
160+
# can ride any rides again. (I.E. No ride can be ridden more than one time
161+
# higher than any other ride. Price should be rounded to nearest cent per ride)
162+
def getThrillRidesRidden(attractions, money):
163+
164+
return ''
165+
166+
# QUESTION 14: THE BIGGEST PARK
167+
# OBJECTIVE A (6): Given your list of attractions (attractions), area of land in square feet (area),
168+
# determine the smallest number of rides you can build to fill up the park.
169+
# Return the ride SUBTYPES in a list
170+
# OBJECTIVE A (2): Sort the Rides Alphabetically
171+
def getTheBestPark(attractions, area):
172+
173+
return ''
174+
175+
# QUESTION 15: THEME PARK FREESTYLE
176+
# OBJECTIVE A (2): The function below has one parameter, attractions, which is a list of dictionaries. (as used earlier).
177+
# Write your own code to calculate a statistic or generate useful data. Return your results in any format.
178+
# OBJECTIVE B (1): Write a two sentence comment explaining what your function does.
179+
# OBJECTIVE C (1): Use at least one previous function from this test in your function.
180+
# OBJECTIVE D (1): Use an import statement to include and use a library
181+
def getStatistics(attractions):
182+
183+
return ''
184+
185+
186+
187+
###############################
188+
# MAIN FUNCTION
189+
# NOTE: It is in your best interest to not modify values in this function.
190+
# Input for the programming questions is test data. The supervisor will use
191+
# different values to grade your program.
192+
###############################
193+
def main():
194+
195+
# Rides and Attractions
196+
attractions = [
197+
{'TYPE':'Roller Coaster','SUBTYPE':'Hyper Coaster','COST':8000000,'SIZE':20424,'CAPACITY':1851,'PROFIT':3702,'FUNRATING':9},
198+
{'TYPE':'Roller Coaster','SUBTYPE':'Giga Coaster','COST':12000000,'SIZE':24408,'CAPACITY':1440,'PROFIT':4320,'FUNRATING':10},
199+
{'TYPE':'Roller Coaster','SUBTYPE':'Wooden Coaster','COST':3000000,'SIZE':32024,'CAPACITY':1751,'PROFIT':3502,'FUNRATING':8},
200+
{'TYPE':'Roller Coaster','SUBTYPE':'Corkscrew Coaster','COST':4500000,'SIZE':8060,'CAPACITY':1920,'PROFIT':2880,'FUNRATING':7},
201+
{'TYPE':'Roller Coaster','SUBTYPE':'Wild Mouse Coaster','COST':2303000,'SIZE':5200,'CAPACITY':1263,'PROFIT':1894,'FUNRATING':7},
202+
{'TYPE':'Roller Coaster','SUBTYPE':'Steel Mini Coaster','COST':1303000,'SIZE':5612,'CAPACITY':2181,'PROFIT':2181,'FUNRATING':5},
203+
{'TYPE':'Roller Coaster','SUBTYPE':'Inverted Coaster','COST':9700000,'SIZE':17208,'CAPACITY':1705,'PROFIT':5115,'FUNRATING':10},
204+
{'TYPE':'Roller Coaster','SUBTYPE':'Bobsleigh Coaster','COST':5520000,'SIZE':19332,'CAPACITY':1384,'PROFIT':3600,'FUNRATING':8},
205+
{'TYPE':'Thrill Ride','SUBTYPE':'Scrambler','COST':300000,'SIZE':900,'CAPACITY':576,'PROFIT':576,'FUNRATING':6},
206+
{'TYPE':'Thrill Ride','SUBTYPE':'Pirate Ship','COST':450000,'SIZE':800,'CAPACITY':600,'PROFIT':900,'FUNRATING':7},
207+
{'TYPE':'Thrill Ride','SUBTYPE':'Go Karts','COST':760000,'SIZE':14000,'CAPACITY':450,'PROFIT':1800,'FUNRATING':7},
208+
{'TYPE':'Thrill Ride','SUBTYPE':'Launched Freefall','COST':2760000,'SIZE':10000,'CAPACITY':2880,'PROFIT':6623,'FUNRATING':8},
209+
{'TYPE':'Thrill Ride','SUBTYPE':'Top Spin','COST':1160000,'SIZE':2500,'CAPACITY':2400,'PROFIT':7200,'FUNRATING':8},
210+
{'TYPE':'Thrill Ride','SUBTYPE':'Enterprise','COST':900100,'SIZE':2500,'CAPACITY':1714,'PROFIT':3428,'FUNRATING':7},
211+
{'TYPE':'Thrill Ride','SUBTYPE':'Swinging Disc','COST':1900100,'SIZE':3600,'CAPACITY':1000,'PROFIT':2000,'FUNRATING':8},
212+
{'TYPE':'Thrill Ride','SUBTYPE':'Zipper','COST':700100,'SIZE':900,'CAPACITY':960,'PROFIT':1440,'FUNRATING':6},
213+
{'TYPE':'Thrill Ride','SUBTYPE':'Orbiter','COST':622200,'SIZE':625,'CAPACITY':654,'PROFIT':654,'FUNRATING':6},
214+
{'TYPE':'Thrill Ride','SUBTYPE':'Gravitron','COST':653200,'SIZE':625,'CAPACITY':782,'PROFIT':1173,'FUNRATING':6},
215+
{'TYPE':'Gentle Ride','SUBTYPE':'Carousel','COST':800000,'SIZE':2025,'CAPACITY':1200,'PROFIT':1200,'FUNRATING':3},
216+
{'TYPE':'Gentle Ride','SUBTYPE':'Ferris Wheel','COST':721000,'SIZE':450,'CAPACITY':800,'PROFIT':800,'FUNRATING':4},
217+
{'TYPE':'Gentle Ride','SUBTYPE':'Super Slide','COST':100100,'SIZE':1050,'CAPACITY':300,'PROFIT':300,'FUNRATING':2},
218+
{'TYPE':'Gentle Ride','SUBTYPE':'Bumper Cars','COST':203200,'SIZE':2500,'CAPACITY':1200,'PROFIT':1800,'FUNRATING':5},
219+
{'TYPE':'Gentle Ride','SUBTYPE':'Observation Tower','COST':510200,'SIZE':2500,'CAPACITY':360,'PROFIT':540,'FUNRATING':3},
220+
{'TYPE':'Gentle Ride','SUBTYPE':'Classic Cars','COST':97200,'SIZE':14000,'CAPACITY':640,'PROFIT':960,'FUNRATING':4},
221+
{'TYPE':'Gentle Ride','SUBTYPE':'Fun House','COST':97200,'SIZE':2020,'CAPACITY':200,'PROFIT':200,'FUNRATING':3},
222+
{'TYPE':'Gentle Ride','SUBTYPE':'Mini Golf','COST':56000,'SIZE':5625,'CAPACITY':144,'PROFIT':720,'FUNRATING':4},
223+
{'TYPE':'Gentle Ride','SUBTYPE':'Circus','COST':80000,'SIZE':5625,'CAPACITY':600,'PROFIT':2400,'FUNRATING':2},
224+
{'TYPE':'Gentle Ride','SUBTYPE':'Pedal Railway','COST':44000,'SIZE':560,'CAPACITY':750,'PROFIT':750,'FUNRATING':3},
225+
{'TYPE':'Gentle Ride','SUBTYPE':'Spinning Dragons','COST':25000,'SIZE':400,'CAPACITY':384,'PROFIT':384,'FUNRATING':4},
226+
{'TYPE':'Water Ride','SUBTYPE':'Log Flume','COST':100500,'SIZE':4024,'CAPACITY':837,'PROFIT':1674,'FUNRATING':6},
227+
{'TYPE':'Water Ride','SUBTYPE':'River Rapids','COST':203100,'SIZE':4300,'CAPACITY':585,'PROFIT':1170,'FUNRATING':7},
228+
{'TYPE':'Water Ride','SUBTYPE':'Dinghy Slide','COST':150200,'SIZE':4228,'CAPACITY':2142,'PROFIT':3214,'FUNRATING':7},
229+
{'TYPE':'Transport Ride','SUBTYPE':'Chairlift','COST':300233,'SIZE':17500,'CAPACITY':1028,'PROFIT':1028,'FUNRATING':4},
230+
{'TYPE':'Transport Ride','SUBTYPE':'Monorail','COST':410000,'SIZE':56016,'CAPACITY':600,'PROFIT':300,'FUNRATING':2},
231+
{'TYPE':'Shop','SUBTYPE':'Burger Bar','COST':14000,'SIZE':400,'CAPACITY':60,'PROFIT':240,'FUNRATING':1},
232+
{'TYPE':'Shop','SUBTYPE':'Drink Stand','COST':11000,'SIZE':400,'CAPACITY':480,'PROFIT':1440,'FUNRATING':1},
233+
{'TYPE':'Shop','SUBTYPE':'Ice Cream Stand','COST':18000,'SIZE':400,'CAPACITY':240,'PROFIT':480,'FUNRATING':1},
234+
{'TYPE':'Shop','SUBTYPE':'Fries Stand','COST':14000,'SIZE':400,'CAPACITY':240,'PROFIT':840,'FUNRATING':1},
235+
{'TYPE':'Shop','SUBTYPE':'Souvenir Shop','COST':20000,'SIZE':400,'CAPACITY':300,'PROFIT':3000,'FUNRATING':1},
236+
{'TYPE':'Shop','SUBTYPE':'Fried Chicken Stand','COST':15000,'SIZE':400,'CAPACITY':120,'PROFIT':840,'FUNRATING':1},
237+
238+
{'TYPE':'Roller Coaster','SUBTYPE':'Mine Train Coaster','COST':3520000,'SIZE':32848,'CAPACITY':1244,'PROFIT':3733,'FUNRATING':8},
239+
{'TYPE':'Thrill Ride','SUBTYPE':'Tilt-A-Whirl','COST':70000,'SIZE':900,'CAPACITY':540,'PROFIT':810,'FUNRATING':6},
240+
{'TYPE':'Gentle Ride','SUBTYPE':'Paratrooper','COST':45000,'SIZE':1225,'CAPACITY':579,'PROFIT':579,'FUNRATING':5},
241+
{'TYPE':'Water Ride','SUBTYPE':'Bumper Boats','COST':56900,'SIZE':2500,'CAPACITY':480,'PROFIT':720,'FUNRATING':5},
242+
{'TYPE':'Transport Ride','SUBTYPE':'Steam Train','COST':282100,'SIZE':80000,'CAPACITY':1200,'PROFIT':1200,'FUNRATING':3},
243+
{'TYPE':'Shop','SUBTYPE':'Cookie Shop','COST':10000,'SIZE':400,'CAPACITY':120,'PROFIT':360,'FUNRATING':1},
244+
{'TYPE':'Shop','SUBTYPE':'Sandwich Shop','COST':11000,'SIZE':400,'CAPACITY':180,'PROFIT':1080,'FUNRATING':1},
245+
{'TYPE':'Shop','SUBTYPE':'Sunglass Shop','COST':10000,'SIZE':400,'CAPACITY':180,'PROFIT':1500,'FUNRATING':1}
246+
]
247+
248+
# Print Question Answer 74 Points Total
249+
print('Source Code - Division B/C - Theme Park - Park Builder')
250+
251+
print('QUESTION 0 OBJECTIVE A (2): '+str(getThemeParkName()))
252+
print('QUESTION 1 OBJECTIVE A (2): '+str(getRideDescription('Roller Coaster','The Screaming Eagle', 10)))
253+
print('QUESTION 2 OBJECTIVE A (2): '+str(getRidePrice(960, 1445)))
254+
print('QUESTION 2 OBJECTIVE B (2): '+str(getRidePrice(960, 1445)))
255+
print('QUESTION 3 OBJECTIVE A (3): '+str(isFit(200000, 123832)) + ', ' + str(isFit(123832, 200000)))
256+
print('QUESTION 4 OBJECTIVE A (3): '+str(getAttractionsCount(attractions)))
257+
print('QUESTION 5 OBJECTIVE A (4): '+str(getAttractionsCountOrganized(attractions)))
258+
print('QUESTION 6 OBJECTIVE A (4): '+str(getRideCost('Gravitron', attractions)))
259+
print('QUESTION 7 OBJECTIVE A (4): '+str(getFunPercentage(attractions)))
260+
print('QUESTION 7 OBJECTIVE B (2): '+str(getFunPercentage(attractions)))
261+
print('QUESTION 8 OBJECTIVE A (5): '+str(getProfitCostRatio(attractions)))
262+
print('QUESTION 9 OBJECTIVE A (5): '+str(getFunRating8Profit(attractions)))
263+
print('QUESTION 10 OBJECTIVE A (5): '+str(getRemainingProfit(3600)))
264+
print('QUESTION 11 OBJECTIVE A (6): '+str(getMaxNumberOfRides(attractions, 12000000)))
265+
print('QUESTION 12 OBJECTIVE A (6): '+str(getAvgFunCharacters(attractions)))
266+
print('QUESTION 13 OBJECTIVE A (6): '+str(getThrillRidesRidden(attractions, 50.00)))
267+
print('QUESTION 14 OBJECTIVE A (6): '+str(getTheBestPark(attractions, 170424)))
268+
print('QUESTION 14 OBJECTIVE B (2): '+str(getTheBestPark(attractions, 170424)))
269+
270+
print('Question 15 OBJECTIVE A (2): '+str(getStatistics(attractions)))
271+
print('QUESTION 15 OBJECTIVE B (1): '+'Check for comment explaining function.')
272+
print('QUESTION 15 OBJECTIVE C (1): '+'Check if previous function in file was called.')
273+
print('QUESTION 15 OBJECTIVE D (1): '+'Check if import statement was used.')
274+
275+
main()

0 commit comments

Comments
 (0)