1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
EastWind [94]
3 years ago
9

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

(Write Code In PYTHON)
Computers and Technology
1 answer:
DanielleElmas [232]3 years ago
8 0

Answer:

?

Explanation:

You might be interested in
Is an example of a relational database management system? (ORACLE ,SQL,JAVA,Python)
olganol [36]

Answer:

The correct answer for the given question is "ORACLE ".

Explanation:

ORACLE is an relational database management system oracle can store the interrelated data .Oracle database management system is used for online transaction etc .It is first company in Relational database management System.

SQL is an structural query language it is used to communicate with a database it is not relational database management system so this option is wrong.

Java and python are the programming language they are not relational database management system so this option is wrong.

So correct answer is "ORACLE "

6 0
3 years ago
The question is provided in the image below.
Vladimir [108]

Answer: b

Explanation:

3 0
2 years ago
If your body were a house, your skeleton would be the house's ___________.
frozen [14]
I think the answer is c wooden frame
3 0
3 years ago
Read 2 more answers
You can restore an event you deleted by mistake in Calendar by ______.
andre [41]

Answer:

1.Clicking on the event date and adding it again

3 0
3 years ago
Write a program that asks for the number of calories and fat grams in a food. The program should display the percentage of calor
Zigmanuir [339]

Answer:

 The solution code is written in Python 3:

  1. calories = int(input("Enter number of calories: "))
  2. fats = int(input("Enter number of fat in grams: "))
  3. if(calories > 0 and fats > 0):
  4.    cf = fats * 9
  5.    if(cf < calories):
  6.        percent = cf / calories  
  7.        if(percent < 0.3):
  8.            print("Food is low in fat")
  9.    else:
  10.        print("Error input. Calories from fat cannot more than total calories")
  11. else:
  12.    print("Error input. Calories and fats must be more than 0")

Explanation:

Firstly, use input function to ask user to enter total number of calories and fat in grams (Line 1-2)

Next we do the first input validation to check if the calories and fats are more than 0 (Line 4). If so apply formula to calculate calories from fats. If not, print error input message (Line 5, 13)

Then we proceed to next input validation to check if calories from fact more than total calories. If so, proceed to calculate percentage of calories from fats and if it is lower than 30%, display the appropriate message (Line 6 - 9). If fail the second input validation, the program will display another error input message again (Line 11)

7 0
4 years ago
Other questions:
  • The ____ directory contains configuration files that the system uses when the computer starts.
    7·1 answer
  • âwhat service uses a private cloud in conjunction with a web browser or downloaded client software to access desktop software?
    10·1 answer
  • Which of the following terms describes a type of useful and legitimate software that is distributed by a developer where they do
    10·1 answer
  • What is output by the following C# code segment?int temp;temp = 180;while ( temp != 80 ) {if ( temp &gt; 90 ) {Console.Write( "T
    7·1 answer
  • Give me 3 companies that utilize audio/video technology
    8·1 answer
  • What's a good drawing tablet?
    12·2 answers
  • 1. in terms of technology, we often said to be living in the _____ age.???
    15·2 answers
  • Join zoom meet for time pass purpose <br><br>id=547 458 9345<br>pw=sencHURI​
    8·2 answers
  • Previous
    11·1 answer
  • Is it possible to see who logged in in youre Microsoft teams account
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!