Answer to Question #317255 in Algorithms for KeKo

Question #317255

You are to write a program that will allow the user to select from a menu of 3 movies available to watch. The menu should look like the following:


  1. Movie 1: Venom: Let There be Carnage
  2. Movie 2: Halloween Kills
  3. Movie 3: Vivo

If the user asks to watch Movie 1, ask for the number of tickets to buy and print the total to pay. The price per ticket for Movie 1 is $8.

If the user asks to watch Movie 2, then the program must ask for his/her age before it proceeds. If the user is younger than 18 years old, the program must print a message saying "Sorry you must be 18 or older to watch this movie." If the user is 18 or older, then proceed to ask how many tickets the user wants and print the total to pay. Price per ticket for Movie 2 is $10.

If the user asks to watch Movie 3, ask for the number of tickets to buy and print the total to pay. The price per ticket for Movie 3 is $6.50.




1
Expert's answer
2022-03-26T05:44:53-0400


Start
Declare Integer selectedMovie 
Declare Integer nTickets
Declare Real total
Declare Integer age
Display "Movie 1: Venom: Let There be Carnage"
Display "Movie 2: Halloween Kills"
Display "Movie 3: Vivo"
Input selectedMovie 
if selectedMovie = 1 then
Display "Enter the number of tickets to buy: "
Input nTickets
Set total=nTickets*8
Display "The total to pay: ",total
end if
if selectedMovie = 2 then
Display "Enter age: "
Input age
if age<18 then
Display "Sorry you must be 18 or older to watch this movie."
else
Display "Enter the number of tickets to buy: "
Input nTickets
Set total=nTickets*10
Display "The total to pay: ",total
End if
end if
if selectedMovie = 3 then
Display ""Enter the number of tickets to buy: "
Input nTickets
Set total=nTickets*6.50
Display "The total to pay: ",total
end if
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS