Question: Below is my Lab4 program. I have been struggling with getting Lab5 which is the continuation of lab4. #include #include #include using namespace std; int

 Below is my Lab4 program. I have been struggling with getting

Below is my Lab4 program. I have been struggling with getting Lab5 which is the continuation of lab4.

#include #include #include using namespace std; int main() { string fname, lname; int hours, rate; fstream file;

file.open("wk4.txt",ios::out);//create a file if(!file) { cout>fname; cout > lname; cout> hours >> rate; file>fname>>lname>>hours>>rate; cout

input file:

Computer Science 40 15.0 Y N Science Computer 30 12.0 Y Y Kompter Cience 40 20.0 Y Y Security Computer 30 30.0 N Y Computer Secrity 40 25.0 Y N John Doe 30 32.0 Y Y Mary Doe 40 40.0 Y Y Mary Jane 30 50.0 N Y Nina Fighter 40 25.0 Y N Hwarang Fighter 40 12.0 Y Y Squid Gaim 40 30.0 Y Y Dori Curier 45 30.0 N Y John Columbus 45 15.0 Y N Ch0ris Seville 35 22.0 Y Y Sunset Granada 30 20.0 Y Y Ronda HighBridge 40 30.0 N Y Pascal Malaga 40 50.0 Y N Michael Angelo 30 32.0 Y Y Osso Frienze 30 40.0 Y Y Marco Plaza 40 25.0 N Y

the first several outputs are in fact names not the majors just examples

As we discussed in class, functions are used to divide a long problem program into small programs. Hence, you can work on several small programs instead of developing one large program. Here you are asked to modify the Payroll program that we have been working on Lab1 and Lab4. Some function prototypes are given for the program, but you may add more functions if you like. //combine fname and Iname; void print-Title(); string read-Name(); int read-Hours(); int read-PayRate(); char/int read-Major(); //read in Major such CPSC, SEC, Not-CS; double compute-Amount (int, double); // Add extra 1000 if Comp Sci; // Add extra 1000 if Comp Sec //Need to use switch statement for full credit; void print-record (string, int, double, double, char); //use setw() to align fields properly; # of Hours Last Name ESU CPSC Your Name First Name Komp Scien 30 40 Hourly Rate 40 30 35 Amount Comp Sci 2200 Y 2200 Y 3400 Y Comp Sec N N Y 40 Add 5 more of your own here... Recommended to use the following to read/print 8 lines

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!