answer.
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
timurjin [86]
2 years ago
4

A dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats

cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section.
Computers and Technology
1 answer:
Talja [164]2 years ago
6 0

Answer:

  1. section_a_cost = 20
  2. section_b_cost = 15
  3. section_c_cost = 10
  4. seatA = int(input("Input number of ticket sold in Section A: "))
  5. seatB = int(input("Input number of ticket sold in Section B: "))
  6. seatC = int(input("Input number of ticket sold in Section C: "))
  7. if(seatA < 0 or seatA > 300):
  8.    print("Input Section A must be between 0 - 300!")
  9. elif(seatB < 0 or seatB > 500):
  10.    print("Input Section B must be between 0 - 500!")
  11. elif(seatC < 0 or seatC > 200):
  12.    print("Input Section C must be between 0 - 200!")
  13. else:
  14.    income = (seatA * section_a_cost) + (seatB * section_b_cost) + (seatC * section_c_cost)  
  15.    print("Total income from ticket sales: $" + str(income))

Explanation:

The solution code is written in Python 3.

Firstly, create three variables to hold the ticket cost for each section A, B and C (Line 1 - 3).

Next, prompt user to input number of ticket sold in Section A, B and C (Line 5 -7).

Validate the input value by using if else if statement to check if the input fall within the range of maximum seat in each section (Line 9 -14). If not, display error message. If the input pass all the validation, the program will calculate the total income from the ticket sales and display the result (Line 16 - 17).

You might be interested in
A Linux systems admin reported a suspicious .py file that ran on a daily schedule after business hours. The file includes shellc
raketka [301]

Answer: Python script

Explanation:

Based on the information given in the question, the type of script that is executing this shellcode is the Python script.

The Python script is a file that contains codes that are written in Python. In such case, the file which contains the python script typically has an extension

which is ".py"' or ".pyw" when it's run on windows

Therefore, based on the information given, the answer is Python script.

8 0
2 years ago
10. There is repeated code in these onevent blocks. Choose the correct code for the updateScreen() function which would be calle
Lorico [155]

Answer:

front zise24

Explanation:

on event down botton

6 0
2 years ago
Shirley was unsure about what career to go into. Her high school counselor suggested a personal assessment to point out Shirley’
Alex73 [517]
<span>I think that she would be well suited in going into law enforcement or fire fighting. Since she loves to stay active and is cool under pressure, both of those jobs would be very well suited for her personality. Those 2 jobs demand to stay cool into delicate situations. Also, she would be able to come in to help people in need.</span>
4 0
2 years ago
Read 2 more answers
Write a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher. The script
jenyasd209 [6]

Answer:

# Request the inputs

codedText = input("Enter the coded text: ")

distance = int(input("Enter the distance value: "))

# Calculate the decryption

# see comment for the rest. Brainly won't let me save an answer which contains code.

Explanation:

Above is your program fixed, but it is unclear on how to deal with unprintable characters, i.e., characters that originally were near the highest printable character ('~')

4 0
2 years ago
Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
pogonyaev

Answer:

The solution for the current situation in which Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar that has appointments and meetings from both personal and business. is:

Configure the Overlay option.

Explanation:

The reasons behind this answer are that in the first place, creating another calendar is too much work. In the second place, the share of the calendars is not going to help her because that would only allow someone else to watch her calendars. However, using the overlay option will allow her to mix them and create one calendar with all her information.

8 0
2 years ago
Other questions:
  • The OSHA Workplace Poster 3165 is optional for workplaces.<br> A) True<br> B) False
    13·2 answers
  • In cell B16, enter a function to calculate the total attendance for the years 2014 through 2018 using the totals in the range B1
    10·1 answer
  • Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if
    13·1 answer
  • Suppose a computer using direct mapped cache has 220 bytes of byte-addressable main memory, and a cache of 32 blocks, where each
    5·1 answer
  • Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
    9·1 answer
  • What technology gets its name from the notion that it ignores the traditional A, B, and C class designations for IP addresses?
    14·1 answer
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    13·1 answer
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!