This is for devc++ int main(){}1. Write a statement that includes theheader files fstream, string,and iomanip in this program.2. Write statements that declare inFile tobe an ifstream variable...


This is for devc++


Description<br>Complete Programmin Exercise 3_1 on<br>Mindtap<br>Consider the following incomplete C++<br>program:<br>#include <iostream><br>int main()<br>{<br>}<br>1. Write a statement that includes the<br>header files fstream, string,<br>and iomanip in this program.<br>2. Write statements that declare inFile to<br>be an ifstream variable and outFile to<br>be an ofstream variable.<br>3. The program will read data from the<br>file inData.txt and write output to the<br>file outData.txt. Write statements to<br>open both of these files,<br>associate inFile with inData.txt, and<br>associate outFile with outData.txt.<br>4. Suppose that the file inData.txt contains<br>the following data:<br>Giselle Robinson Accounting<br>5600 5 30<br>450 9<br>75 1.5<br>The first line contains a person's first<br>name, last name, and the department<br>the person works in. In the second line,<br>the first number represents the monthly<br>gross salary, the bonus (as a percent),<br>and the taxes (as a percent). The third<br>line contains the distance traveled and<br>the traveling time. The fourth line<br>contains the number of coffee cups<br>sold and the cost of each coffee cup.<br>Write statements so that after the<br>program executes, the contents of the<br>file outData.txt are as shown below. If<br>necessary, declare additional variables.<br>Your statements should be general<br>enough so that if the content of the<br>input file changes and the program is<br>run again (without editing and<br>recompiling), it outputs the appropriate<br>results.<br>Name: Giselle Robinson, Department: Accounting<br>Monthly Gross Salary: $5600.00, Monthly Bonus: 5.00%, Taxes: 30.00%<br>Paycheck: $4116.00<br>Distance Traveled: 450.00 miles, Traveling Time: 9.00 hours<br>Average Speed: 50.00 miles per hour<br>Number of Coffee Cups Sold: 75, Cost: $1.50 per cup<br>Sales Amount = $112.50<br>Formulas for calculation:<br>payCheck = grossSalary *<br>(1+bonus/100) * (1-tax/100)<br>avg_speed =<br>distanceTravelled/travelTime<br>sales_amount =<br>numberOfCups*costOfeachcup<br>%3D<br>%3D<br>5. Write statements that close the input<br>and output files.<br>6. Write a C++ program that tests the<br>statements in parts a through e.<br>

Extracted text: Description Complete Programmin Exercise 3_1 on Mindtap Consider the following incomplete C++ program: #include int main() { } 1. Write a statement that includes the header files fstream, string, and iomanip in this program. 2. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable. 3. The program will read data from the file inData.txt and write output to the file outData.txt. Write statements to open both of these files, associate inFile with inData.txt, and associate outFile with outData.txt. 4. Suppose that the file inData.txt contains the following data: Giselle Robinson Accounting 5600 5 30 450 9 75 1.5 The first line contains a person's first name, last name, and the department the person works in. In the second line, the first number represents the monthly gross salary, the bonus (as a percent), and the taxes (as a percent). The third line contains the distance traveled and the traveling time. The fourth line contains the number of coffee cups sold and the cost of each coffee cup. Write statements so that after the program executes, the contents of the file outData.txt are as shown below. If necessary, declare additional variables. Your statements should be general enough so that if the content of the input file changes and the program is run again (without editing and recompiling), it outputs the appropriate results. Name: Giselle Robinson, Department: Accounting Monthly Gross Salary: $5600.00, Monthly Bonus: 5.00%, Taxes: 30.00% Paycheck: $4116.00 Distance Traveled: 450.00 miles, Traveling Time: 9.00 hours Average Speed: 50.00 miles per hour Number of Coffee Cups Sold: 75, Cost: $1.50 per cup Sales Amount = $112.50 Formulas for calculation: payCheck = grossSalary * (1+bonus/100) * (1-tax/100) avg_speed = distanceTravelled/travelTime sales_amount = numberOfCups*costOfeachcup %3D %3D 5. Write statements that close the input and output files. 6. Write a C++ program that tests the statements in parts a through e.
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here