subject

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 CHS2021 gets a 5% discount, and anyone with coupon code CHSVIP 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 ("CHS2021" or "CHSVIP").
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, "CHS2021" or "CHSVIP" ) 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.

Example output:
Are you a student or adult (enter s or a)? a
Is this for a game today? no
Do you have a coupon? yes
What is the code? CHS2021
Your cost is: $9.5

Press enter to exit
Are you a student or adult (enter s or a)? s
Is this for a game today? yes
Do you have a coupon? no
Your cost is: $7.0

Press enter to exit

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type)] and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to zero, it should output wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the â€r’ or â€r’ team, their game time will be 10% faster. and if they are on the â€b’ or â€b’ team, their game time will be 15% faster. and if they are on the â€y’ or â€y’ team, their game time will be 20% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 6 but less than or equal to 12 and if they are on the â€r’ or â€r’ team, their game time will be 20% faster. and if they are on the â€b’ or â€b’ team, their game time will be 25% faster. and if they are on the â€y’ or â€y’ team their game time will be 30% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 12 but less than or equal to 18 and if they are on the â€r’ or â€r’ team, their game time will be 30% faster. and if they are on the â€b’ or â€b’ team, their game time will be 35% faster. and if they are on the â€y’ or â€y’ team, their game time will
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
You can apply several different worksheet themes from which tab?
Answers: 1
You know the right answer?
Write a program that determine the admission price for a person to attend the sectionals game. Any d...
Questions
question
Mathematics, 05.11.2020 17:40
question
Mathematics, 05.11.2020 17:40
question
Social Studies, 05.11.2020 17:40
question
English, 05.11.2020 17:40
question
Geography, 05.11.2020 17:40
Questions on the website: 13722367