Lab 5 ABC Movie Theater Write a C++ program to assign customer seats in a movie...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Lab 5 ABC Movie Theater Write a C++ program to assign customer seats in a movie theater. ABC is a small movie theater with seats for 40 people in 8 rows of 5 seats each. So, the first thing you need to do is filling up the layout array. See the sample display below for a layout of the theater. The user enters the row (1-8) and the seat (A-E). The program checks the array to see if the seat is available. An X in the array indicates the seat is not available. If the seat is available, assign an X to that position in the array, If it's unavailable, display a message to the passenger. There are two types of membership: -Gold (Free popcorn and coke) -Silver (Free coke) Price of each ticket: -Gold member: $22 -Silver member: $20 -No member: $18 Note: You need another array to keep track of the sales. Continue processing requests until the user enters -1 for row. For each customer, the program should ask the row number, the seat letter and the type of the membership. (We have customers that are not members). After each customer display the layout table. And after-1 is entered for the row, display -number of seats sold. percentage occupied. -sales report. You need to include the following functions in your program. - Function to get the row and seat and membership: This function displays a prompt requesting the value for row. If-1 is not entered for the row, the function displays a prompt requesting the seat letter. The seat can be an upper or lowercase letter (Check how the toupper function works in Chapter Six, Display 6.9). This function is a call-by- reference since it needs to supply main with two values. Check Display 5.4 getNumbers function and Display 5.9 getInput function. These two functions are call-by-value. -Function to display the theater layout using the layout array. - Function to display the Sales Report, using the membership and the prices according to the membership. - Any additional functions that make the program more modular. Develop C++ program with the following new features: •Arrays o Arrays and functions o User defined header files. Advice from the Instructor: As usual, code this problem in small steps, one function at a time. In main, the row and seat values need to be converted to indices for the layout array. The row value needs to be converted to a legal index from 0 to 7. You can use one statement to adjust the row index. The seat letter needs to be converted to a legal index from 0 to 4. Consider subtracting the ASCII value 65 from the value of the seat entered to change the index. It only takes one statement to adjust the column index using this technique. To produce the correct column results: 'A'-65-0 'B'-65 -1 °C -65-2 'D'-65 = 3 'E' -65-4 o The advantage of arrays is the same in C++ as in Java - often reducing the amount of code you need. First make sure your program works correctly and then go back and see if you can write the code more efficiently. Sample Outputs: Sample Report: A B C AX CD A B C ABCDE ABCDE ABCDE ABCDE ABCDE **** Enter the row number: -1 Lab 5 ABC Movie Theater Write a C++ program to assign customer seats in a movie theater. ABC is a small movie theater with seats for 40 people in 8 rows of 5 seats each. So, the first thing you need to do is filling up the layout array. See the sample display below for a layout of the theater. The user enters the row (1-8) and the seat (A-E). The program checks the array to see if the seat is available. An X in the array indicates the seat is not available. If the seat is available, assign an X to that position in the array, If it's unavailable, display a message to the passenger. There are two types of membership: -Gold (Free popcorn and coke) -Silver (Free coke) Price of each ticket: -Gold member: $22 -Silver member: $20 -No member: $18 Note: You need another array to keep track of the sales. Continue processing requests until the user enters -1 for row. For each customer, the program should ask the row number, the seat letter and the type of the membership. (We have customers that are not members). After each customer display the layout table. And after-1 is entered for the row, display -number of seats sold. percentage occupied. -sales report. You need to include the following functions in your program. - Function to get the row and seat and membership: This function displays a prompt requesting the value for row. If-1 is not entered for the row, the function displays a prompt requesting the seat letter. The seat can be an upper or lowercase letter (Check how the toupper function works in Chapter Six, Display 6.9). This function is a call-by- reference since it needs to supply main with two values. Check Display 5.4 getNumbers function and Display 5.9 getInput function. These two functions are call-by-value. -Function to display the theater layout using the layout array. - Function to display the Sales Report, using the membership and the prices according to the membership. - Any additional functions that make the program more modular. Develop C++ program with the following new features: •Arrays o Arrays and functions o User defined header files. Advice from the Instructor: As usual, code this problem in small steps, one function at a time. In main, the row and seat values need to be converted to indices for the layout array. The row value needs to be converted to a legal index from 0 to 7. You can use one statement to adjust the row index. The seat letter needs to be converted to a legal index from 0 to 4. Consider subtracting the ASCII value 65 from the value of the seat entered to change the index. It only takes one statement to adjust the column index using this technique. To produce the correct column results: 'A'-65-0 'B'-65 -1 °C -65-2 'D'-65 = 3 'E' -65-4 o The advantage of arrays is the same in C++ as in Java - often reducing the amount of code you need. First make sure your program works correctly and then go back and see if you can write the code more efficiently. Sample Outputs: Sample Report: A B C AX CD A B C ABCDE ABCDE ABCDE ABCDE ABCDE **** Enter the row number: -1
Expert Answer:
Answer rating: 100% (QA)
The instructions provided are for a lab exercise where a C program is to be written for managing a movie theater seating arrangement and ticket sales ... View the full answer
Related Book For
Essentials Of Computer Organization And Architecture
ISBN: 9781284259438
6th Edition
Authors: Linda Null, Julia Labur
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Are there dangers with incarcerating young people in detention facilities? What about the potential for negative long-term impact? Using three documented examples of misconduct/mistreatment of youth...
-
A mail-order firm processes 5,300 checks per month. Of these, 60 percent are for $55 and 40 percent are for $80. The $55 checks are delayed two days on average; the $80 checks are delayed three days...
-
Yello Bus Lines uses the units-of-activity method in depreciating its buses. One bus was purchased on January 1, 2019, at a cost of $148,000. Over its 4-year useful life, the bus is expected to be...
-
Basic Construction Company was engaged in the road-paving business. Two of its lower-level managers rigged bids by giving competitors the prices that Basic would bid for work. That is a criminal...
-
What do you think led mankind to embark upon the study of Artificial Intelligence? Which fields of study particularly fed into it? What human desires did the study of Artificial Intelligence seek to...
-
Target Corporation holds assets with a fair market value of $4 million (adjusted basis of $2.2 million) and liabilities of $1.5 million. It transfers assets worth $3.7 million to Acquiring...
-
Does an excellent Employee Value Proposition make their employees want to stay with a company for a long time? how
-
Two flow control loops axe shown in the drawing. Indicate whether each system is either a feedback or a feed-forward control system. Justify your answer. It can be assumed that the distance between...
-
A certain star is 15.7 million light-years from Earth. The intensity of the light that reaches Earth from the star is 2.10 10 21 W/m 2 . At what rate does the star radiate EM energy?
-
a ) A stock is currently priced at $ 3 0 and is expected to pay a dividend of $ 0 . 3 0 in 2 0 days and 6 5 days from now. What will be the contract price for a 6 0 - day forward contract when the...
-
Which impression management tactic is Cassandra using when she asks for help planning the retirement party when she could do it easily on her own? a . self - promotion b . supplication c ....
-
Please answer question correctly and explain why your answer is correct. Due to the broadcasting character of wireless signal, we cannot only rely on the physical access control to protect it. O...
-
Mega Skateboard Supplier had net sales of $ 3 . 7 million, its cost of goods sold was $ 1 . 4 million, and its net income was $ 0 . 9 million. What will be Its gross margin ratio?
-
You manage a risky portfolio with an expected rate of return of 1 0 % and a standard deviation of 2 0 % . The Treasury bill ( risk - free security ) rate is 5 % . Suppose that your client prefers to...
-
Entity P acquired 80% of S several years ago. Entity P presents the statement of profit or loss and other comprehensive income as a single statement. Items in other comprehensive income are shown net...
-
Define a traverse in Surveying?
-
True Or False: Expanding opcodes make instruction decoding much easier than when it is not used.
-
In our discussion of the SSTF disk scheduling algorithm, we stated that the problem of starvation is at its worst with low disk utilization rates. Explain why this is so.
-
Name three different types of buses and where you would find them.
-
How do you use functional requirements for this chapter?
-
How do you apply nonfunctional requirements for this chapter?
-
Identify the EBT for the word deployment.
Study smarter with the SolutionInn App