0 of 1 Questions completed
Questions:
You have already completed the practice exercise before. Hence you can not start it again.
Practice Exercise is loading…
You must sign in or sign up to start the practice exercise.
You must first complete the following:
0 of 1 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Question: Imagine you’re going out with friends, and grabbing margaritas beforehand. Each margarita costs $10. Dependent on which bar you go to afterwards, you’ll spend the following in cover:
Bar A: $20
Bar B: $10
Bar C: $5
Create a program that asks the user to input the number of margs they’ll have, and the letter of the bar they’ll go to afterwards. Then, calculate and print the total cost of the night out. See the GIF below for expected output:
Fill in the program below!
# Enter the bar covers
bar_a =
bar_b =
bar_c =
# Create the variable that’ll eventually store chosen bar’s cover
bar_cover = 0
# Ask the user how many margs they’ll have
marg_count = (input(“How many margs will you have?”))
# Ask the user for their bar choice
bar_choice = input(“Enter the letter of the bar you’ll go to afterwards. (A, B, C)”)
# Determine the chosen bar cover cost
if :
bar_cover = bar_a
bar_choice == “B”:
bar_cover = bar_b
elif bar_choice == “C”:
# Determine the total cost of the night out
total_cost = (per_marg_cost * ) +
# Print the final message to the user
print(“You will spend a total of $” + + “.”)