Find Jobs
Hire Freelancers

c++

$30-50 USD

Cerrado
Publicado hace casi 16 años

$30-50 USD

Pagado a la entrega
Problem Statement: Write a program that can be used by a small theatre to sell tickets for performances. The theatre’s auditorium has 15 rows of seats, with 30 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theatre. Seats that are taken are represented by an * symbol, and seats that are available are represented by a #symbol: Seats 123456789012345678901234567890 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 ############################## Row 15 ############################## Legend: * = Sold # = Available ## Deliverables Problem Statement: Write a program that can be used by a small theatre to sell tickets for performances. The theatre’s auditorium has 15 rows of seats, with 30 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theatre. Seats that are taken are represented by an * symbol, and seats that are available are represented by a #symbol: Seats 123456789012345678901234567890 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 ############################## Row 15 ############################## Legend: * = Sold # = Available The ticket prices of seats may vary from row to row, however, ticket prices for any given row is the same. Here is a list of tasks this program must perform: 1. When the program begins (initialisation): a. The seat prices for each row should be read from “C:\Temp\[login to view URL]? file (a sample fie is provided). If [login to view URL] file cannot be opened, the program should display an error message and set the price of all rows to be $10.50. In [login to view URL] file, each line specifies ticket price of a row starting from row 1. If [login to view URL] file is incomplete (i.e. prices not available for all 15 rows), the remaining rows should be set a value 300027 2008.1 Assignment 2 Version 1.01 1 of $10.50. If [login to view URL] file has more than 15 lines, then remaining lines should be ignored. b. The ticket sales data should be read from “C:\Temp\[login to view URL]? file (a sample file is provided). Each line in [login to view URL] file specifies a row number and a seat number of a sold ticket. If [login to view URL] file has incorrect entries (e.g. row numbers less than 1 or seat numbers greater than 30), the program should display an error message and ignore the entry. If [login to view URL] file cannot be opened, then program should display an error message and assume that all seats are available (i.e. there were no prior ticket sales). c. Calculate the value of total ticket sale, based on the seat prices and ticket sales data. 2. Once the program has completed the initialisation tasks (Task 1 above), the program should display a menu with the following selections and functions: a. Display available seats. When this option is selected, the program should display a seating chart similar to the one that is shown in the previous page. b. Display seating prices. When this option is selected the program should list the seat prices of each row (row number and the price). c. Display total ticket sales. This should display the current total ticket sales (the number of tickets and the value in $). d. Purchase a ticket. When this option is selected, the program should request from the user, the row and seat number of the ticket being purchased. The user should be given an option to purchase more than one ticket at a time. Every time a ticket or group of tickets is purchased, the program should display the total of ticket purchase. The user should be given an option of viewing this amount. When tickets are being sold, row or seat numbers that do not exists should not be accepted. When a user requests a particular seat, the program should make sure that seat is available before it is sold. e. Exit the program. When this option is selected, the program should write all ticket sale data to C:\Temp\[login to view URL] file and exit. The sale data should include the data read during initialization (from [login to view URL] file). 3. Log file of ticket sales: Each time a ticket or group of tickets is purchased, purchase data should be logged into a log file. This log file must not be overwritten and must always be appended. The log file should be also written during initialization with an entry for tickets already sold. The log file should be located in the directory C:\Temp and the name of the file is to SalesLog.txt. 300027 2008.1 Assignment 2 Version 1.01 2 The program should perform appropriate input validation when necessary. The program may assume that all the inputs are integer numbers. The program should not terminate when input / output files cannot be read / written. Sample [login to view URL] file: 40 40 35 35 30 25 25 Sample [login to view URL] file: 3 5 4 5 3 2 5 10 11 12 12 22 12 23 Sample Menu Screen: Sample display of available seats: 300027 2008.1 Assignment 2 Version 1.01 3 Sample display of Ticket Sales: Sample [login to view URL] file: Initialization: ticket already sold in row 3 and seat 5 Initialization: ticket already sold in row 4 and seat 5 Initialization: ticket already sold in row 3 and seat 2 Initialization: ticket already sold in row 5 and seat 10 Initialization: ticket already sold in row 11 and seat 12 Initialization: ticket already sold in row 12 and seat 22 Initialization: ticket already sold in row 12 and seat 23 Purchase: ticket in row 2 and seat 5 Purchase: ticket in row 4 and seat 6 Sample [login to view URL] file: 2 5 3 2 3 5 4 5 4 6 5 10 300027 2008.1 Assignment 2 Version 1.01 4 11 12 12 22 12 23 Instructions: 1. The program will be run and assessed in your practical session on the week beginning 5 May 2008. 2. You must submit a copy of your program (the .cpp file) only. The file name should be of the form [login to view URL] where studentID is your student ID. 3. Include an identification section in the program (at the beginning). This is important and should include the following information. /* Student Name: ………………………………………. Student Number: ……………………………………………. Date: ……………………………… File Name: ………………………………… */ 4. Submission will be via WebCT ONLY. Further details on submission will be posted on WebCT. There will be no allowance for late submissions. Marking Scheme and Grading Criteria will be provided later. 300027 2008.1 Assignment 2 Version 1.01 5
ID del proyecto: 3920211

Información sobre el proyecto

Proyecto remoto
Activo hace 16 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos

Sobre este cliente

Bandera de AUSTRALIA
Australia
0,0
0
Miembro desde may 9, 2008

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.