Write a program that takes, as its input, a C++ program and does the following: Counts the number of lines, excluding completely blank lines. Counts the number of open braces. { Counts the number of close braces. } Your program should request the name of a .CPP file from the user, looping if the name is not valid. Once it encounters a valid name, it should process the file as described. The output should be three lines: the number of lines, the number of open braces, and the number of close braces.
Explanation / Answer
#include #include using namespace std; int main () { ifstream file; char fileName[100]; int openBrace = 0; int closeBrace = 0; int line = 0; char ch = ' '; char prevCh = ' '; cout