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
garik1379 [7]
3 years ago
5

There are three seating categories at a stadium. Class A seats cost $20, Class B seats cost $15, and Class C seats cost $10. Wri

te a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales.
Computers and Technology
1 answer:
Westkost [7]3 years ago
5 0

Answer:

Following are the program to this question:

def calculate_income(num,seat):#defining method calculate_income

   if seat=="A": #defining condition for seat a

       return num * 20 #return value

   if seat=="B": #defining condition for seat b

       return num * 15 #return value

   if seat=="C": #defining condition for seat c

       return num * 10 #return value

def show_income(a,b,c): #defining method show_Income

   sum=a+b+c # add total seats income

   print("Income for A class seats: $",a) #print value

   print("Income for B class seats: $",b) #print value

   print("Income for C class seats: $",c) #print value

   print("Total Income: $",sum) #print value

def main(): # defining main method

   a=int(input("Enter class A seats: ")) #input seats a value

   b=int(input("Enter class B seats: ")) #input seats b value

   c=int(input("Enter class C seats: ")) #input seats c value

   a_income=calculate_income(a,"A")  #call method for seat a

   b_income=calculate_income(b,"B") #call method for seat b

   c_income=calculate_income(c,"C") #call method for seat c

   show_income(a_income,b_income,c_income) # call method show_income for print all seat value

main()

Output:

Enter class A seats: 2

Enter class B seats: 3

Enter class C seats: 2

Income for A class seats: $ 40

Income for B class seats: $ 45

Income for C class seats: $ 20

Total Income: $ 105

Explanation:

The description of the above program can be described as follows:

  • In the above python program, three methods "calculate_income, show_income, and the main method" were defined.  
  • The method "calculate_income" accepts two-variable "num and seat" as the parameter, inside the method a three if block is used, that calculate all types of seat class rate and returns its value.
  • In the "show_income", we add all the seat value in the sum variable and use the print method, that prints all seat cost, and total cost.
  • In the main method, we input all seat value from user input and pass into the calculate_income method and collect all the return value, after calculating calculate_income we pass its return value into the show_income method, that prints all value.
You might be interested in
List 4 criteria of power your house with wind
andrew-mc [135]

Answer:

1st Is that you don't need to pay for electricity.

2nd It's that yo don't poluate the nature.

3rd It depends of the country, in some of them you can get some support for this from the state , I mean you can get lower prices for water and staff like that.

Hope I helped you , have a nice da

4 0
3 years ago
Anybody play apex legends? I need somebody to climb with in comp (I main octane)
Verdich [7]

Answer:

yes

Explanation:

my profile pic tho add me jujubi1988

6 0
4 years ago
Unscramble the risks of sharing files on the Intern
Zinaida [17]

Answer:

Broken Firewall, Piracy, Malware, Virus, adware

Explanation:

Please give brainliest if this helps

4 0
3 years ago
Hardware failure, power outages, and DOS attacks will affect:
const2013 [10]

Answer:

The answer should be data availability

6 0
3 years ago
Which key on a laptop keyboard is often used to help pair a mobile device with another device for communication purposes?
Nonamiya [84]

Bluetooth on a laptop is often used to help pair a mobile device with another device for communication purposes.

  • Bluetooth

<u>Explanation:</u>

A Bluetooth gadget works by utilizing radio waves rather than wires or links to associate with your mobile phone, cell phone or PC. Bluetooth is a remote innovation standard utilized for trading information among fixed and cell phones over short separations utilizing short-wavelength UHF radio waves in the modern, logical and restorative radio groups, from 2.400 to 2.485 GHz, and building individual zone systems. For instance, on Windows, either right-click the Bluetooth symbol in the notice zone or go to the Control Panel to discover the Hardware and Sound > Devices and Printers page. At the point when the gadget shows up in the rundown of Bluetooth and different gadgets, select it to associate (pair) it to the workstation.

7 0
4 years ago
Other questions:
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • Which type of spreadsheet cell represents the left hand sides (lhs) formulas in an optimization analysis?
    5·1 answer
  • I’m which scenario would someone most likely be using presentation software ?
    6·2 answers
  • Variables set equal to patterns are said to be:_______.
    7·1 answer
  • What’s the purpose of balancing or monitoring your checking account?
    12·2 answers
  • Hey anyone wanna zoom.
    7·2 answers
  • Which type of storage disk and disk drive can you use in the given situation?
    9·1 answer
  • Alex has composed a layout with this Image for a magazine. Which rule of composition has Alex applied?
    14·1 answer
  • Sự ra đời của thương mại điện tử có tác động như thế nào đến việc quảng cáo và Marketing sản phẩm
    11·2 answers
  • I am trying to do a python code quiz for school, the basic requirements for the quiz are: the quiz MUST have 10 questions
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!