In this exercise, you explore the use of integers in monetary calculations.
a. Follow the instructions for starting C++ and opening the Advanced15.cpp file. If necessary, delete the two forward slashes that appear before the system("pause"); statement, and then save the program. Run the program. When you are prompted to enter the gross pay, type 45.13 and press Enter. The net pay that appears on the computer screen is incorrect because it is not the result of subtracting the taxes from the gross pay. Press any key to stop the program.
b. Reviewthe code contained in the Advanced15.cpp file.The #include
c. Why does the net pay appear as $33.85 rather than $33.84? Hint: Change the cout << fixed << setprecision(2) << endl; statement to a comment, and then save and run the program. Type 45.13 as the gross pay and press Enter. Study the output, and then stop the program and change the comment back to a statement.
d. Use the comments that appear in the Advanced15.cpp file to modify the program’s code. (Start with the comment on Line 14 in the program.) Why do you need to add .5 to the expressions that calculate the federal and state taxes? e. Save, run, and test the program to verify that it is working correctly, and then stop the program.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.