You are to write a small calculator program as a console application in C++. The program should have the following functionality:
The program should then repeatedly read and process calculations written in the form:
number operator number =
20 + 10 =
where operator can be +, -,* , / and the numbers are type float not integer.
If valid numbers were read in (test with [url removed, login to view]()) then the program will go on to test the operator and =, otherwise if non-numeric characters were read in then clear the error ([url removed, login to view](0)), empty the buffer ([url removed, login to view](128, ‘\n’)) and output the error message:
ERROR 3: invalid numeric input
If the last character entered is and the operator belongs to the set +, -,* , / then carry out the sum and output the result in the form:
number operator number = answer
20 + 10 = 30
In the case of division, check the second number to see whether it is 0.0; if it is, output the message:
ERROR 4: unable to divide by zero
If the last character is not ‘=‘ then, assuming the user typed ‘&‘ instead of output the error message:
ERROR 1: & read in where = was expected
And if the operator did not belong to the set +, -, /, * then, assuming the user typed ? instead, output the error message
ERROR 2: ? read in where +, -, I, or * expected
After each calculation prompt and read as follows:
Another calculation (YIN)?
If their reply is ‘y or ‘Y’ then prompt for the next calculation, otherwise output a summary of successful calculations as follows:
There were 10 out of 23 successful calculations.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.