Question: Activity #1 Write a C++ program that outputs its own source code to the screen. It should do this by opening the code as a

Activity #1

Write a C++ program that outputs its own source code to the screen. It should do this by opening the code as a file, and outputting all of its contents.

Activity #2

For this activity you will need to modify your program so it is able to count all the opening and closing parentheses ( ), braces { }, and brackets [ ] inside itself by reading all the contents using . The program must have a function void fileProcessing() that runs all the logic of opening, manipulating, and closing the file. This void fileProcessing() is responsible for determining the number of opening and closing symbols, and outputting the results. Your main function should only make a call to the void fileProcessing() function.

Your program must print the total number of all the parentheses, braces, and brackets. Below is the expected output:

Number of (: 5 Number of ): 5 Number of {: 11 Number of }: 11 Number of [: 2 Number of ]: 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!