- 1

Coding Help

Hello! I'm trying to learn python, but this one question has me stuck. Anyone know the answer? Prompt: Write a program that determine the admission price for a person to attend the sectionals game. Any day prior to game day, adult tickets cost $10, and student tickets cost $6. On game day, the cost of each ticket goes up by $1. People with a coupon can get a discount. Anyone with coupon code DISCOUNT gets a 5% discount, and anyone with coupon code VIP gets a 10% discount. This program should have 3 functions: askUser: This function asks the user all of the important questions (adult or student, game day or not, if they have a coupon or not and if so what the code is). This function takes in NO parameters and returns NO values. This function updates 4 global variables: status ("a" or "s" for adult or student), gameDay (True or False), hasCoupon (True or False), and coupCode ("DISCOUNT" or "VIP"). getCost: This function takes in two parameters: string st (for status "a" or "s") and boolean gd (for game day True or False). Based on the inputted values, it calculates and returns one integer value, cost. getDiscount: The function takes in two parameters: coup (coupon code, "DISCOUNT" or "VIP" ) and c (cost). The function should only be called if hasCoupon is True. The function calculates and returns one decimal (float) value for the new discounted cost, discCost.

25th Jan 2022, 4:57 AM
ethan
1 Answer
+ 2
Can you show us what you tried so far? If you don't know how to start, I suggest you go to the python beginner course and start from there. We are here to help you learn but this is not a place to find simple solutions
25th Jan 2022, 6:39 AM
Sandy Ho
Sandy Ho - avatar