Introduction To C++ Programming Please properly line comment your C++ source! Objectives: Primary objective is to learn how to use the C++ fileI/O, use character literals, and bool objects. The second...

Introduction To C++ Programming Please properly line comment your C++ source! Objectives: Primary objective is to learn how to use the C++ fileI/O, use character literals, and bool objects. The second objective is to learn how to create C++ project with lineComment.cpp in Clion. The third objective is to sharpen your skills in using CLion Integrated Development Environment (IDE), in particular, to edit, compile (translate), execute, and fix syntax and logic (semantics) error if any. Instructions: Your C++ instructor at school believes that the students are not writing enough line comments in their C++ code. You have been given the responsibility of checking on your peers. Your instructor asks that you count the number of C++ line comments in each file in a project. Due to the superior knowledge that you obtained when studying COP3014 chap5 and chap6, you are asked to write a C++ program that will count the number of C++ line comments in an input C++ source file. you should first prompt the user for an input file name and output file name. If the input file cannot be opened, then you should re-prompt the user until the user supplies a file that can be opened. Likewise, a similar process should be performed for the output file. You should then read each character from the input file to search for a line comment. Whenever a line comment is found, print the line number of the corresponding line comment to the output file. After all characters of the input file being processed, you should write the total number of line comments in the input file to the output file. You may assume valid C++ code as input. Sample program run: Enter an input file name: sample.cpp Enter an output file name: report.txt Sample sample.cpp input file: #include using namespace std; int main() { // This is the line comment. cout
Jun 26, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here