C++ beginner class practice problem Please put //comments in so I understand the program Consider the following incomplete C++ program: #include int main() { ... } Write statements that include the header files fstream, string, and iomanip in this program. Proceed through all the steps in this activity by clicking on the Next Step button below after completing each step. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable. 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 Associate outFile with outData.txt Suppose that the file inData.txt, data set 1, contains the following data: Giselle Robinson Accounting 5600 5 30 450 9 75 1.5 Write statements that close the input and output files. The file inData.txt is provided for you with the following data: Giselle Robinson Accounting 5600 5 30 450 9 75 1.5 Run your program, and ensure that outData.txt is created and has the following lines: 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
C++ beginner class practice problem
Please put //comments in so I understand the program
Consider the following incomplete C++ program:
#include <iostream>int main()
{
...
}
Write statements that include the header files fstream, string, and iomanip in this program.
Proceed through all the steps in this activity by clicking on the Next Step button below after completing each step.
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
- Associate outFile with outData.txt
Suppose that the file inData.txt, data set 1, contains the following data:
Giselle Robinson Accounting 5600 5 30 450 9 75 1.5
Write statements that close the input and output files.
The file inData.txt is provided for you with the following data:
Giselle Robinson Accounting 5600 5 30 450 9 75 1.5Run your program, and ensure that outData.txt is created and has the following lines:
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.50Required C++ code given below:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images