In C++, use SML programs to accomplish each of the followingtasks:
a) Use a sentinel-controlled loop to read positive numbers andcompute and display their sum. Terminate input when a negativenumber is entered.
b) Use a counter-controlled loop to read seven numbers, somepositive and some negative, and compute and display theiraverage.
c) Read a series of numbers, and determine and display thelargest number. The first number read indicates how many numbersshould be processed.
For input you should read the instructions from a file (afterprompting the user for the name of the file to read). Make theintro banner say \"Welcome to Simpletron! Enter the name of the filecontaining your program:\"
Here is a sample of the output expected:
Execution halted normally
REGISTERS:
accumulator -1
instructionCounter 6
instructionRegister 4300
opcode 43
operand 0
MEMORY:
0 1 2 3 4 5 6 7 8 9
0 1007 1008 2007 3008 2109 1109 4300 4 -5 -1
10 0 0 0 0 0 0 0 0 0 0
. . .
90 0 0 0 0 0 0 0 0 0 0
Please show the output files for a, b, and c. Thank you.