Lab Assignment
Lab 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:
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.