Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Absolutely no arrays or vectors may be used ) Purpose:Under the Charm budgetary measures, fill rates will determine the number of sections offered by a

Absolutely no arrays or vectors may be used) Purpose:Under the Charm budgetary measures, fill rates will determine the number of sections offered by a department and whether a given class will be canceled or not.In this Lab you will write a C++ program to determine fill rates and output report needed by the CIS department. See file Spring2024.txt . Structure mandated: There is to be main(), an output() function and no other function except for an optional signature function.In main() open an input file Spring2024.txt that will remain open for the entire program execution.Also in main() open an output file that will remain open until the end of the execution (see slide 9 of Everything you need to know about File I/O).Output the heading directly to the file from main().Within a loop process the following input, calculation, and output until end of file.Inputstring for course CRN number,string for class name (e.g. CIS D002.-62Z),string for modalityinteger for current enrollmentinteger for maximum enrollment,integer for number of students on wait-list,Use getline(file, string name) to input text with spaces such as the name of the class. You will enjoy knowing about file.ignore(). Mac users usually are using a text editor that has \r\l i.e. two characters, at the end of each line. See separate item in this module. If modality is not "ONLINE" change it to "HYBRID". Computation Warning: avoid integer division truncation issues. File rate is sum of current enrollment plus number of students on wait-list divided by the maximum enrollment. N.B. If the maximum enrollment is zero, skip this data completely since dividing by zero is undefined.Output: Call output function to output to the file opened the CRN #, class title, the fill rate formatted with one digit to the right of the decimal point, and the modality. After all data is read, i.e. after the loop is done executing, output the highest fill rate along with the class name (only these two data items!) THEME ISSUES: file input, file output Sample output:CRN Course Fill Modality Rate %00428 CIS 002.64Z 75.0 ONLINE41239 CIS 003.02Z 52.5 ONLINE44153 CIS 003.03Z 50.0 ONLINE. ..47835 CIS 398.64Z 86.7 ONLINE47777 CIS 399.64Z 113.3 ONLINEHighest Fill Rate: CIS D040.64Z 163.3

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions