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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.

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:

  1. Open both of these files
  2. Associate inFile with inData.txt
  3. 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
Expert Solution
Step 1

Required C++ code given below:

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education