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
Which statement shows that Kenya is a multicultural society?
kobusy [5.1K]

Answer: I believe your answer would be B

Explanation:

Kenya is a multi-ethnic nasion where over 42 ethno- linguistic. multi-ethnic means made up of people of various ethnicities a multi-ethnic country also: of relating to, reflecting, or adapted to diverse ethnicities multiethnic literature. And diverse geography means differences among groups of people and and individuals based on ethnicity, race, socioeconomic status, gender, exceptionalities, language, religion, ect. Also the make-up of Kenyans is primarily that of 13 ethnic groups with and additional 27 smaller groups. (Hope this helps sorry if it's wrong)

4 0
3 years ago
Which government decision would best be handled at the state level
ArbitrLikvidat [17]
<span>Each type of government has its own jurisdiction and powers. In the United States of America, there was a clear division between what the state oversees and what the federal government oversees. But, there are instances wherein the federal government can influence the decisions of the state government by blocking its grants.</span>
8 0
3 years ago
G a farmer urges his horse to pull a wagon. the horse refuses, saying to try would be futile for it would flout newton's third l
lora16 [44]
<span>forces do not cancel out because they act on different bodies </span>
<span>also the forces acting on the horse is not just the force he exerts on the wagon </span>
<span>he also applies force on the ground so the static friction on the ground helps the horse move forward </span>

<span>forces acting on the horse are friction in its direction of motion and the tension opposing motion </span>
<span>if the surface has enough friction he can always move</span>
4 0
3 years ago
How did the hoplite phalnx and the tactics used by greek general miltiades contribute to the success of the greeks?
Shalnov [3]

Answer: Around the 5th century bc, the Persians under Cyrus the Great had rapidly expanded their domain. By the time of Darius I, the Persian empire covered most of southwest Asia and Asia Minor, reaching as far as the easternmost boundaries of Europe. The Persians demanded tribute and respect from all they dominated. The Greek cities in Asia Minor eventually decided to throw off the Persian yoke. Through those revolts, the assistance of the Athenians and the ensuing Battle of Marathon, the wheels had been set in motion to end Persian domination.

Explanation: hope it helps ^w^

4 0
3 years ago
A marshmallow is placed in front of 6-year-old Roxana. She is told that she can eat it now, or wait alone for five minutes witho
gizmo_the_mogwai [7]

Answer:

What are the answer choices

Explanation:

6 0
3 years ago
Other questions:
  • Consider a problem taking place in your community and view it geographically. How does this problem affect your city on both a l
    7·1 answer
  • Why did the Spanish government send missionaries to the borderlines?
    14·1 answer
  • Please help!<br> brainliest will be given to proper answers
    9·1 answer
  • If the government wants to jump-start the economy resulting in more consumer spending, it will raise taxes. true or false?
    5·1 answer
  • Why did Elbridge Gerry of Massachusetts redraw the congressional districts in his state
    12·1 answer
  • Currently, life expectancy in north america is about ______ years for men and ______ for women.78; 8078; 7176; 8175; 75
    6·1 answer
  • Choose one information and communication technology (ICT) whose design, or some aspect of its design, elicits a strong emotion f
    15·1 answer
  • What were the early people of colombia very good at? sailing skiing trading farming.
    11·2 answers
  • Which of the following is one of the Five Pillars of Islam?
    11·2 answers
  • Examples of eight month crops​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!