Question: OBJECTIVE: We need practice in using loops, using sentinels in processing input, comparing data, summing data, using counters, and documenting a program using comments and

OBJECTIVE: We need practice in using loops, using sentinels in processing input, comparing data, summing data, using counters, and documenting a program using comments and we don't have much time. Thus this is a short assignment. PROBLEM BACKGROUND: Write a program that reads and processes sets of data, from standard input (stdin), until a sentinel value of a negative number. A set is three numbers (a triplet) where: the first number in a set is a room number, the second is the room's capacity, and the third is the size of the class scheduled to meet in that room. For each triplet set, print an output line showing the classroom number, capacity, number of seats filled, number of seats available, and a message ("FULL" or "OPEN") indicating whether the classroom is filled or not. These must be printed in columns formatted exactly as shown in the sample output below. You must also print a heading over the columns; again, refer to the sample output for the precise format.) After all classrooms have been processed, a summary is to be printed. The form and content of the summary are explained in the sample output section. SAMPLE OUTPUT: If your input file contained the following data (just the numbers): Room Capacity Class Size 426 25 25 PYTHON VIA RANGER CODE PLEASE. 327 14 420 20 15 18 317 100 90 -1 - 1 -1 your program must produce the following output (spaced, labeled, punctuated, and formatted exactly as shown): Room Capacity Size Empty Seats 426 25 25 327 18 14 4 20 15 5 317 100 90 10 Status FULL OPEN OPEN OPEN 420 Rooms: 4 Overall Capacity: 163 Total Enrollment: 144 Number of Open Rooms Remaining: 3 ***************************************** OBJECTIVE: We need practice in using loops, using sentinels in processing input, comparing data, summing data, using counters, and documenting a program using comments and we don't have much time. Thus this is a short assignment. PROBLEM BACKGROUND: Write a program that reads and processes sets of data, from standard input (stdin), until a sentinel value of a negative number. A set is three numbers (a triplet) where: the first number in a set is a room number, the second is the room's capacity, and the third is the size of the class scheduled to meet in that room. For each triplet set, print an output line showing the classroom number, capacity, number of seats filled, number of seats available, and a message ("FULL" or "OPEN") indicating whether the classroom is filled or not. These must be printed in columns formatted exactly as shown in the sample output below. You must also print a heading over the columns; again, refer to the sample output for the precise format.) After all classrooms have been processed, a summary is to be printed. The form and content of the summary are explained in the sample output section. SAMPLE OUTPUT: If your input file contained the following data (just the numbers): Room Capacity Class Size 426 25 25 PYTHON VIA RANGER CODE PLEASE. 327 14 420 20 15 18 317 100 90 -1 - 1 -1 your program must produce the following output (spaced, labeled, punctuated, and formatted exactly as shown): Room Capacity Size Empty Seats 426 25 25 327 18 14 4 20 15 5 317 100 90 10 Status FULL OPEN OPEN OPEN 420 Rooms: 4 Overall Capacity: 163 Total Enrollment: 144 Number of Open Rooms Remaining: 3 *****************************************
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
