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
GaryK [48]
3 years ago
7

Write an application to pre-sell a limited number of cinema tickets. Each buyer can buy as many as 4 tickets. No more than 100 t

ickets can be sold. Implement a program that prompts the user for desired number of tickets and then display the number of remaining tickets. Do not allow the user to enter an invalid number of tickets. Repeat until all tickets have been sold, and then display the total number of buyers. Safe the file as Tickets.java.
Social Studies
1 answer:
aliya0001 [1]3 years ago
8 0

Answer:

Python code explained below

Explanation:

<u>**CODE: </u>

tickets = 100

count = 0

# Loop runs until tickets become zero

while tickets !=0:

   print("There are currently", tickets, "tickets remaining.")

   # Taking input from user for tickets

   userInput = int(input("How many tickets would you like to purchase?"))

   # If user enters more than 4 tickets

   if userInput > 4:

      print("You cannot purchase more than 4 tickets")

   # If available tickets are less than user requirment

   elif tickets < userInput:

      print("Available tickets are less than required")

   else:

       # Count increment to store the users who brought

       count += 1

       # Decrementing the available tickets with the user requirements

       tickets -= userInput

       print("Transaction successful")

   print()

print("All the tickets are sold")

print("The total number of buyers was ", count)

You might be interested in
The next step in your plan is to identify which government regulations will impact your business. In two to three sentences, exp
kompoz [17]

(I'll try to do it in 2-3 sentences).

First, the government will influence my relationship with my employees by creating a safety standard that I should follow when cresting business.

Second, the government will influence my budgeting since they can create minimum wage laws that determine how much money I can spend on my employees.

Third, the government will create a safer competition by banning strategies or business proactive that can directly hurt other people

4 0
3 years ago
What is the highest and lowest classes in ancient China?
Kay [80]
Highest: <span>SHI – GENTRY SCHOLARS<span> 
lowest: </span></span><span>SHANG – MERCHANTS AND TRADERS</span>
8 0
3 years ago
Read 2 more answers
I need help on understanding can some one help me amendment one
Taya2010 [7]
The first amendment grants people’s freedom, expression, rights, religion, and assembly. It basically grants us our rights and freedom. A good artwork you can draw or add would be like a protest (freedom of speech). You can look up what the constitution states for the first amendment and print that out or type it word for word. (Hope this helps!!)
5 0
3 years ago
Which of the following was part of the legacy of Alexander the Great?
likoan [24]

B. Greece and regions of Asia came to share a common culture and language.

Explanation:

  • Hellenism in a broader sense is a spread of Greek culture at all stages of its development, as well as the acceptance of that culture and language by other, non-Greek peoples.
  • In recent historiography the term Hellenism encompasses all historical and cultural events that continued into the Greco-Macedonian penetration into the East under Alexander Great to create a huge state organization under his reign.

Learn more on Alexander the Great on

brainly.com/question/10444657

brainly.com/question/1286645

#learnwithBrainly

4 0
3 years ago
How has the federal,state and local government worked to slow the loss of Louisiana's wetlands?
sukhopar [10]
I live in Louisiana, and i know our government has stopped hunting in wetlands and building in wetlands. <span />
8 0
4 years ago
Read 2 more answers
Other questions:
  • What date did the songhai empire start and end
    14·1 answer
  • Match these items.
    6·1 answer
  • Michael is an adolescent whose parents have always expected him to become a lawyer. Without considering any other options throug
    6·1 answer
  • What was the name of the battle where Alexander's Army defeated the Persians?
    7·2 answers
  • Which of the following was NOT provided for by the Articles of Confederation?
    9·1 answer
  • Who is the protagonist of the meet
    7·1 answer
  • Maggie just received word that she's getting a big promotion and is very happy. cynthia just received word that she is being lai
    7·1 answer
  • The utopian socialist factory owner from Great Britain who worked to improve conditions for his workers was
    6·2 answers
  • Opinion about the<br> help provided for children of<br> Nepal by plan Nepal.
    10·1 answer
  • Name 2 free trade agreements the U.S. is a member of : ( pls help )
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!