Question: Write a program will correct a C++ program that has errors in which operator, or , it uses with cin and cout. The program replaces
Write a program will correct a C++ program that has errors in which operator, or , it uses with cin and cout. The program replaces each (incorrect) occurrence of:
cin
with the corrected version
cin >>
and each (incorrect) occurrence of
cout >>
with the corrected version
cout
Allow for the possibility that there may be any number of whitespace characters (one or more) between cin and and between cout and . The replacement corrected version has only one blank between the cin or cout and the following operator. You should not correct other whitespace characters in the input file (such as those at the start of a line).
Your program should get the source filename as an input from the user. The corrected version should be output to a file called corrected.txt (it cannot be called anything else) and the output should also be displayed on the terminal. That is, the output of your program should be exactly same as the contents of the file corrected.txt.
Your program should define at least one function that is called and that manipulates the read line from the input file. If your program does NOT have at least this function, you will not get credit for this part of the assignment, even if your program passes submit.cs grading.
You will need to use multiple member functions to manipulate strings in this program. In addition, you will have to use the getline() function in the library in order to read an entire line by ifstream.
A session should look like the following example (including whitespace and formatting):

Write a program will correct a C++ program that has errors in which operator, or it uses with cin and cout. The program replaces each (incorrect) occurrence o with the corrected version and each (incorrect) occurrence of cout with the corrected version cout Allow for the possibility that there may be any number of whitespace characters (one or more) between cin and and between cout and or. The replacement corrected version has only one blank between the cin or cout and the following operator. You should not correct other whitespace characters in the input file (such as those at the start of a line). Your program should get the source filename as an input from the user. The corrected version should be output to a file called "corrected.txt (it cannot be called anything else) and the output should also be displayed on the terminal. That is, the output of your program should be exactly same as the contents of the file "corrected.txt". Your program should define at least one function that is called and that manipulates the read line from the input file. If your program does NOT have at least this function, you will not get credit for this part of the assignmen even if your program passes submit.cs grading You will need to use multiple member functions to manipulate s rings in this program In addition, you will have to use the getline function in the library in order to read an entire line by ifstream A session should look like the following example (including whitespace and formatting): Enter filename: original txt winclude kiostream> using namespace std; int main cout Hello return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
