Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Purpose to practice Writing and evaluating loop logic Selecting the correct loops types Using loops Problem Statement Code a program to print (output) a
Purpose to practice Writing and evaluating loop logic Selecting the correct loops types Using loops Problem Statement Code a program to print (output) a ticket for each person in a group. Remember to back-up your program before you begin the next phase. Phase 1 Ask the user to choose an event from the menu. You can make up your own events. Ex. o A. DC Auto Show - $49 B. NSO at the Kennedy Center - $90 o C. Capitol's Hockey Game - $150 Ask the user for the number of tickets they want Ask the user to enter their name You can make up a price for the event (based on the event they chose) Print (output) as many tickets as the user requested Output the total amount of all tickets for that customer THEN : Ask the user, "Do you want to make another purchase?" (use a yes/no dialog box for this). Use the BEST loop types for this scenario. ents HINT: This lab requires 2 loops. Phase 2 - (Optional) Add an error loop to make sure that the user entered A, B or C Phase 3 - Challenge - Not Required Remove processing from the main() and execute it in a function. Write the function in the SAME file as the main() Sample Run Welcome to Tickets 120 C A. DC Auto Show B. NSO at the Kennedy Center C. Capital's Hockey Game What event are you attending? How many tickets do you want? 5 Enter your name Enter your name Marge Simpson Capital's Hockey Game - 1 admission $99.00 Capital's Hockey Game - 1 admission $99.00 Capital's Hockey Game - 1 admission $99.00 Capital's Hockey Game - 1 admission $99.00 Capital's Hockey Game - 1 admission $99.00 Your Total is: $495.00 Do you want to make another purchase? y/n Y A. DC Auto Show B. NSO at the Kennedy Center C. Capital's Hockey Game What event are you attending? a How many tickets do you want? 2 Enter your name Marge Simpson DC Auto Show - 1 admission $29.99 DC Auto Show - 1 admission $29.99 Your Total is: $59.98 Do you want to make another purchase? y/n N Thank you for using Tickets 120. Enjoy your event. Required Material to be Submitted to Blackboard A copy of your program source code saved to a .TXT file A screen capture of your program being executed, with the result showing Your source code must include the following comment code at the beginning of your program: Lab # Name: your name
Step by Step Solution
★★★★★
3.42 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
The problem statement describes a programming exercise where you are tasked with creating a program that simulates a ticket purchase system for various events Here are the main components of the probl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started