0% found this document useful (0 votes)
8 views

Lab Assignment

The document outlines two programming assignments for a theater ticketing system and a grading program for multiple-choice exams. The first task involves creating a ticket sales program that displays seat availability, manages ticket sales, and tracks total sales and available seats. The second task requires developing a grading program that compares student answers to correct answers from a file, providing feedback on missed questions and pass/fail status based on performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lab Assignment

The document outlines two programming assignments for a theater ticketing system and a grading program for multiple-choice exams. The first task involves creating a ticket sales program that displays seat availability, manages ticket sales, and tracks total sales and available seats. The second task requires developing a grading program that compares student answers to correct answers from a file, providing feedback on missed questions and pass/fail status based on performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment

Task: 1
Here is the assignment: 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 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 theater. Seats that are taken are represented
by an * symbol, and seats that are available are represented by a # symbol:

Here is a list of tasks this program must perform:


 When the program begins, it should ask the user to enter the seat prices
for each row. The prices can be stored in a separate array. (Alternatively,
the prices may be read from a file.)
 Once the prices are entered, the program should display a seating chart
similar to the one shown above. The user may enter the row and seat
numbers for tickets being sold. Every time a ticket or group of tickets is
purchased, the program should display the total ticket prices and update
the seating chart.
 The program should keep a total of all ticket sales. The user should be
given an option of viewing this amount.
 The program should also give the user an option to see a list of how many
seats have been sold, how many seats are available in each row, and how
many seats are available in the entire auditorium.
Input Validation: When tickets are being sold, do not accept row or seat
numbers that do not exist. When someone requests a particular seat, the
program should make sure that seat is available before it is sold.

Task: 2
One of your professors has asked you to write a program to grade her final
exams, which consist of only 20 multiple-choice questions. Each question has
one of four possible answers: A, B, C, or D. The file CorrectAnswers.txt, which is
on the Student CD, contains the correct answers for all of the questions, each
answer written on a separate line. The first line contains the answer to the first
question, the second line contains the answer to the second question, and so
forth.
Write a program that reads the contents of the CorrectAnswers.txt file into a one-
dimensional char array, and then reads the contents of another file, containing a
student’s answers, into a second char array. The Student CD has a file named
StudentAnswers.txt that you can use for testing purposes. The program should
determine the number of questions that the student missed, and then display
the following:
 A list of the questions missed by the student, showing the correct answer
and the incorrect answer provided by the student for each missed
question
 The total number of questions missed
 The percentage of questions answered correctly. This can be calculated as
Correctly Answered Questions ÷ Total Number of Questions
 If the percentage of correctly answered questions is 70% or greater, the
program should indicate that the student passed the exam. Otherwise, it
should indicate that the student failed the exam.

You might also like