Assignment | Lab代写 | C++代写 – LAB C++

Assignment | Lab代写 | C++代写 – 这是一个简单的C++的lab代做任务,属于基础训练题目

LAB

Add the necessary code to the source file Payroll5.cpp , that reads and processes each line of input in the sequential input file payroll.txt. The lines of the file begin with a string with an embedded blank that should be interpreted as an employee name. After the name, the input line contains a single pound (#) character followed by 3 double values. These should be interpreted as an employees hourly salary, the number of hours that the employee has worked and the taxrate as a percentage that is used for that employee. After inputing the remaining data on the input line, your program should display formatted values of the input values followed by the employees gross salary (hours hourly, with time and one-half for the number of hours beyond 40) and the net salary (the gross salary minus the gross salary the taxrate/100). Upon reaching the end of the file, your program should display the total of all of the gross salaries and the total of all of the net salaries. All monetary amounts should be right justified and formatted to display 2 digits to the right of the decimal point. All output for this program should be displayed on the monitor and should be embedded within functions. The file Payroll5.cpp contains functions instructions() and reportTitle() that display a descriptive message and the column headings, respectively. In addition, the file should use functions calculateGross() to calculate the gross pay for each employee, calculateNet() to calculate the net pay for each employee, displayEmployeeInfo() to display the salary information for each employee and totalAmounts() to display the total gross and total net. Keep in mind that three of the six aforementioned functions have already been written for you.

You should compile, execute and examine the code in Payroll5.cpp to try and understand the use of the functions instructions() and reportTitle(). For this assignment and the next, well take advantage of the make command. This command uses a file named makefile that automates the compilation process of our program. It is especially useful for large programs that consist of multiple files and well be using it from here on in with our laboratories. Issue the following commands to compile your source code. make payroll5. This command will create an executable called payroll5 . To run your program enter the command payroll

A Sample run using the data in the file payroll.txt is shown below. To gain full credit for this lab, the output must be formatted as shown below

Make sure to upload your source file to directory labs/ Once your lab is uploaded and while logged into the server via a terminal session, traverse to the directory labs/ 5 . YOU MUST BE IN DIRECTORY 5 , TO SUBMIT YOUR LAB. Once you are ready to submit your lab issue the command _submit csc155abc 5 _ where abc is the course section number.

发表评论

邮箱地址不会被公开。 必填项已用*标注