6.3k views
2 votes
Write a program that allows a user to continuously enter a row and seat request until a sentinel value is entered. If the row or seat number is too high, issue an error message. Otherwise, determine whether the seat has already been reserved. If so, display an error message; if not, then charge the user $7.50 for a ticket and display a running total of the user’s purchase. When the user enters a sentinel, display the number of seats taken and the number still available in the auditorium.

What is the purpose of the sentinel value in the program?

A) To mark the beginning of the program.
B) To indicate the end of seat and row requests.
C) To trigger an error message.
D) To calculate the running total.

1 Answer

5 votes

Final answer:

The purpose of the sentinel value in the program is to indicate the end of seat and row requests. When the sentinel value is entered, the program will display the number of seats taken and the number still available in the auditorium.

Step-by-step explanation:

The purpose of the sentinel value in the program is to indicate the end of seat and row requests.

When a sentinel value is entered, the program will stop accepting seat and row requests and proceed to display the number of seats taken and the number still available in the auditorium.

This allows the program to know when to terminate the input loop and provide the final information to the user.

User Irongirl
by
7.2k points