Thursday, July 30, 2009

Visual c++ Calculator help PLEASE!!!?

C++ Calculator Help PLEASE!!!!?


I am so sick this week.... DO NOT GET A FLU SHOT!


It was a very big mistake.





Im having a very hard time concentrating on this program, THis is the assignemt PLease help me.





In this assignment you must implement a simple integer calculator. The arithmetic functions of addition, subtraction, multiplication, modulus, and division are to be supported. The calculator contains an Accumulator that stores the current result. The Accumulator is also involved with each operation. Make sure that you define a class for this program.


Once started, the Accumulator is set to zero, and the operation to be performed is set to addition (+). The program then repeats the following steps:








Request and Accept a number


Apply the stored operation (Acc op= number)


Request and Accept the next operation


This process repeats until the equals sign (=) is entered as an operation. At this point, the Accumulator contents are displayed and the calculator is reset (Accumulator set to zero and operation to +).


The following characters are legal operations:





+, -, *, %, /, =, and !.





The ! is treated the same as =, but causes the program to terminate. Any other characters entered as operations should cause a brief error message and should be ignored. Division by zero errors cause a reset.


Sample run:








SuperCalculator at you service!


------


Input: 10


Operation: *


Input: 2


Operation +


Input: -5


Operation: =


Result: 15


------


Input: 12


Operation: /


Input: 0


**Division by zero - start over


------


Input: 12


Operation: %26gt;


**Invalid operation - ignored


Operation: /


Input: 5


Operation: =


Result: 2


------


Input: 10


Operation: %


Input: 6


Operation: *


Input: 3


Operation: !


Result: 12





------


SuperCalculator Off!

Visual c++ Calculator help PLEASE!!!?
Please try searching the web using yahoo or google.


No comments:

Post a Comment