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
What might have happened had Civil War not occurred?
ASHA 777 [7]
There would still be slaves in the south
4 0
2 years ago
Which colonial area or areas placed a high value on religious freedom?
Vinil7 [7]
<span>b: New England and Middle</span>
5 0
3 years ago
Read 2 more answers
According to the screencast, the problem with our mass media has not been that they have been teaching us "bad values" so much a
NISA [10]

Answer:

right and wrong , good and evil, right and left, and us and them

Explanation:

According to the screencast, the problem with our mass media has not been that they have been teaching us "bad values" so much as they have been inundating us with "bad narratives" by which your instructor means narratives where everything is too-simplistically reduced to <u>right and wrong , good and evil, right and left, and us and them</u>.

.

6 0
2 years ago
Read 2 more answers
Miranda is learning how to play tennis. she has a unique way of hitting a backhand shot, but after a lesson with a professional
vitfil [10]
Miranda has learned to improve her tennis due to observational learning which is also called social learning. It is a theory that occurs when a beholder’s behavior become different after viewing or observing the behavior of his/her model. He/she can be affected by the positive or negative outcome-called indirect or derivative reinforcement or punishment.
4 0
3 years ago
After reading many books and magazine articles about tennis star Serena Williams, fourth grade student Caroline pretended that s
vichka [17]

Answer: Simulated journal

Explanation: Having learnt or read about a person or celebrity, one may decide to imitate or emulate some of the individual's ideology or behavior. In the scenario above, Caroline decided to imitate and take after Serena's perceptions and ideas. Putting a viewpoint synonymous with that of such individual into writing after having read about them is called a simulated journal, a writing which is intended to follow in the footsteps or ideology of a certain individual which one decides to pretend to be.

3 0
3 years ago
Other questions:
  • Which one was strictly ruled by the Motherland?
    11·1 answer
  • What was the connection between civil disobedience and abolition movement
    6·2 answers
  • Individuals and businesses are the only decision makers. What economy is this?
    8·1 answer
  • Criteria such as; behavior going against social norms, behavior that causes subjective discomfort, maladaptive behavior that cau
    5·1 answer
  • The Minnesota Twins, a professional baseball team, wanted to develop creative ways to boost sagging attendance at their ball gam
    7·1 answer
  • Which Louisiana group is famous for the contributions of Acadian language, jazz, folk tales, and great food to the culture of Lo
    10·1 answer
  • Crisis de la ilustracion​
    7·1 answer
  • Which are examples of how Lester Maddox changed his views on race relations? Check all that apply.
    7·1 answer
  • Investigate the influence of self esteem and teenagers participating risky behaviour​
    5·1 answer
  • +<br> Where was most of the land granted in the headright system located?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!