Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ You are hired by the university to write a program that will take user input regarding classrooms and output some general class size information

C++
image text in transcribed
image text in transcribed
image text in transcribed
You are hired by the university to write a program that will take user input regarding classrooms and output some general class size information as well as some comprehensive information. To do this you will need to write a complete program that reads and processes sets of data containing three pieces of information for each room in the following order:
1. the room number,
2. the maximum capacity of the room,
3. and the current number of students enrolled.
A negative value for the room number ends the user input. For each room, you will need to output information that displays the classroom number, maximum capacity, and number of seats filled (enrolled), as well as, the number of seats available, and a message (FULL, OPEN, "OVER") indicating whether the classroom meets enrollment, has available seats, or is over enrolled. After all classrooms have been processed, a general summary regarding all rooms should also be output.
Program Requirements
1. Follow the style guide.
2. All input will come from stdin which means you will be using cin. Read the note included in
the sample runs to see how to test your program without having to type all of the
information from the files.
3. DO NOT open the file and use it within your program.
4. You must include the following functions:
o ReadRoomData: a void function that accepts three reference parameters (the room number, max capacity, and enrolled). It should read in all three values from stdin.
o DetermineStatus: a value-returning function that has one parameter (available enrollment). It should return a std::string containing the status of the room (OPEN, FULL, OVER)
o OutputRoomInfo: a void function that accepts three value parameters (room, max capacity, and enrolled). It should call DetermineStatus and output the formatted room information for that single set of data.
5. All output should be spelled, spaced, and formatted according to the sample runs below.
6. DO NOT FORGET to submit a zip file containing just the main.cpp file to the Open Lab 2
dropbox on D2L.
Sample Runs
In order to test these programs, you will need to make use of input redirection in the shell. Input redirection is a feature of our operating system that allows us to pass input from
a file over stdin (the keyboard buffer) without having to open and connect to the file within our program. In the shell, you can execute the following command after you compile your
program: ./a.out
The
Program Requirements 1. Fellew it 1r jle juide inlpwation tom the Les. 3. Da yedt epen the fip esi ine a wipingor jappon B994N RHI. CNTR Sample Runs wung aft makrispo Sample Runs Tatal nereflesety (3) wipen-lak-211 2. Sevile Man 1 . 1. Sessie Aint Fowe capecter foriliea ceay tered niatei Rasar in OvenalH Giparacy. Tinal gomilenti at - ieremetahezal

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions