Question: In C++ Write a program that calculates Net Pay. It should do this by calling a function called CalNetPay that calculates and returns Net Pay
Write a program that calculates Net Pay. It should do this by calling a function called CalNetPay that calculates and returns Net Pay when given the hours worked and the hourly pay rate. Arguments must be passed to CalNetPay By Value. CalNetPay MUST RETURN Net Pay, it must use a return statement. The main function should pass the hours worked and pay rate to the function CalNetPay. The main function should get the hours worked and pay rates from a file called Lab2A3Input.txt that you will create. From the main function: 1) Print to the Screen; 2) Print to an output file called Lab2A3Output.txt, the Net Pay for each record in the Input file. Lab6A3Input should contain the following lines: 2 10.5 5 20 10 30.2 Your program should open the Input file and make sure the open was successful . Your program should use a while Loop to process and read the data from the Input file. The while loop should continue execution as long as values are read from the file Don't forget to close your input and output files when done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
