Display the seating chart of a theater

Assignment Help Computer Engineering
Reference no: EM132211516

Write a program that can be used by a small theater to sell tickets for performances. The theater's auditorium has 15 rows of seats with 20 seats in each row.

Step 1: The program should have a FUNCTION that displays a screen that shows which seats are available and which are taken. Seats that are taken should be represented by a # symbol and seats that are available should be represented by a * symbol. The first thing your program should do is initialize all of the seats to available (*) and display the seating chart. (HINT: The seating chart should be a two dimensional array.) Below is an example of the seating chart with all seats initialized to available.

Seats: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Row 0 * * * * * * * * * * * * * * * * * * * *
Row 1 * * * * * * * * * * * * * * * * * * * *
Row 2 * * * * * * * * * * * * * * * * * * * *
Row 3 * * * * * * * * * * * * * * * * * * * *
Row 4 * * * * * * * * * * * * * * * * * * * *
Row 5 * * * * * * * * * * * * * * * * * * * *
Row 6 * * * * * * * * * * * * * * * * * * * *
Row 7 * * * * * * * * * * * * * * * * * * * *
Row 8 * * * * * * * * * * * * * * * * * * * *
Row 9 * * * * * * * * * * * * * * * * * * * *
Row 10 * * * * * * * * * * * * * * * * * * * *
Row 11 * * * * * * * * * * * * * * * * * * * *
Row 12 * * * * * * * * * * * * * * * * * * * *
Row 13 * * * * * * * * * * * * * * * * * * * *
Row 14 * * * * * * * * * * * * * * * * * * * *

Step 2: Each row in the auditorium has a different ticket price. So tickets in row 0 may be 5.00 each and tickets in row 1 may be 10.00 each. Your program should have a FUNCTION that asks the user to enter a ticket price for each row. The price of tickets for each row should be stored in a one dimensional array.

Step 3: Your program should have variables tracking the total number of tickets sold and the total revenue for all tickets sold.

Step 4: Your program should allow the user to sell tickets one at a time. The user should be able to sell as many tickets as they would like (you need a loop for this). Do this with some sort of prompt or menu asking the user if they would like to sell another ticket. Don't forget to validate input data if you need to.

To allow the user to sell a ticket your program should have the user enter a row number and a seat number for the ticket they would like to sell. The program should do four things with this information:

It should check to see if the seat is available. If the seat is taken the program should not allow the user to sell the ticket. If this happens, print a message to the user saying the ticket is not available and prompt the user to see if they would like to sell another ticket.

If the seat is available the program should update the seating chart by putting a taken symbol (#) in that seat's position in the chart.

The program should then look up the row price for the seat sold. Your program should have a variable tracking the total revenue, the price of the seat sold should be added to this total after each sale.

Your program should have a variable tracking the total tickets sold. The next thing your program should do when selling a ticket is update the total tickets sold.

Step 5: Once the user is finished selling tickets print out an updated seating chart followed by the total tickets sold and the total revenue generate from those tickets.

NOTE: You are required to use two arrays in this program, one for the seating chart and one to store the prices for each row. You are also required to use two functions: one to display the seating chart and one to read in the price per row data and store it in the array with the prices for each row in it.

Reference no: EM132211516

Questions Cloud

Write a program using cygwin that calculates tension : Write a program using Cygwin that calculates tension. Declare variables and input your own number.
Write a program that uses a function matrix to add matrices : Write a program that uses a function matrix_addition {} to add two matrices and put the result into a third matrix .
Take a series of int values as command line arguments : Calculate a total from the values, but add the values that are even, and subtract the values that are odd.
Display a temperature on two 1bit 7segment displays : Write a program using the Arduino Uno to display a temperature on TWO 1bit 7segment displays.
Display the seating chart of a theater : Write a program that can be used by a small theater to sell tickets for performances.Display the seating chart of a theater.
Write a program that takes two words as input from keyboard : Write a program that takes two words as input from the keyboard, representing a password and the same password again.
Perform the addition of two byte sized numbers : Write a program in TASM that performs the addition of two byte sized numbers that are initially stored in memory locations 'num1' and 'num2'.
Write a prolog recursive predicate that tells us : This knowledge base holds facts about towns you can travel between by taking a direct train, e.g., from union station to san bernardino.
Write a program which outputs the numbers from 1 to 80 : Write a program, using nested loops, which outputs the numbers from 1 to 80 in 8 columns and 10 rows.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are the major data structures used in rdbms

What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

  Propose two different approaches to handling given situation

Suppose that you are in charge of knowledge management and have a highly knowledgeable IT person who refuses to transfer knowledge. Propose two different approaches to handling this situation.

  Unix and window trace route

Compare and contrast some of the differences between the UNIX (and Linux) and the Window Trace route. All codes for each ICMP error message are not fully listed and described.

  Implement a radix sorting machine

Implement a radix sorting machine. A radix sort for base 10 integers is a mechanical sorting technique that utilizes a collection of bins and one main bin.

  How to create two sql scripts

Then make two SQL scripts. The first should be a DDL code for your tables, data, and PL/SQL package. The second should be an SQL script to show the testing of the execution of the package.

  What historical data might be useful

What additional measures would have to be made for projects A and B to determine which of the teams eliminated errors more efficiently? What metrics would you propose to help in making the determination?

  Draw a circuit for one contact switch

Give the configuration of the interrupt associated registers if one door and one window are monitored (using two contact switches)

  How proposed business is a lawnmower business

Main function, this will provide the menu interface to get to all the rest of them, it will basically be the switch statement that calls the other functions and returns their values.

  Briefly discuss the likelihood of occurrence

Briefly discuss the likelihood of occurrence and the potential impact to the store or businesses operations for each of the four risks you identified

  Discuss the concept of least privilege and methods

Discuss the concept of least privilege and methods to provide it using the text Internet, and/or your job as reference for full credit

  Explain the itil framework minimize the impact of change

The ITIL framework evolved from the UK Government's efforts during the 1980s to document how successful organizations approached service management. In what ways can the ITIL® framework minimize the impact of change

  Write a program where the number of characters is counted

Write a C++ program where the number of characters in each word of a text file is counted. I'm having trouble defining in my loop exactly when a word begins.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd