-Please submit only C++ source files (*.cpp) through the Blackboard Vista. -Please put your name, project description, and date on the top of your file as a comment. -PLEASE WORK ALONE. If cheating is found, you will get ZERO.
- (Lastname_Lab10_p1.cpp, 20 points)
Write a C++ program to read the employee.txt file and produce a duplicate copy of the file named employee.bak. Accept the names of the original and duplicate files as user input. (You can provide a default duplicate file name for users.)
- (Lastname_Lab10_p2.cpp, 20 points)
Write a program that opens a file and display the contents of the file with associated
line numbers. That is, the program should print the number 1 before displaying the first line, and then print the number 2 before displaying the second line, and so on for each line in the file.
- (Lastname_Lab10_p3.cpp, 20 points)
Create a text file containing the following: car numbers, miles driven, and gallons of
gas used in each car (do not include the headings):
|Car Number||Miles Driven||Gallons Used|
Write a program that reads the data in the file and displays the car number, miles driven, gallons used and the miles per gallon for each car. The output should also contain the total miles drive, total gallons used, and average miles per gallon for all the cars. These totals should be displayed at the end of the output report.
- 4. (Lastname_Lab10_p4.cpp, 20 points)
Write a program that accepts lines of text from the keyboard and writes each line to a file named text.dat until an empty line is entered. An empty line is a line with no text that is created by pressing the Enter (or Return) key.
- (Lastname_Lab10_p5.cpp, 20 points)
Write a program that skips leading whitespace characters in each line of the provided data file verse.txt. Save the results in a new file.
- (OPTIONAL, Lastname_Lab10_p6.cpp, 20 points)
Write a program that removes the blank lines in verse.txt and saves the results in a new file. (You can combine p5 and p6 to get a new file without leading whitespaces and blank lines.)