Question: Extra Credit ( try if you have extra time ) Develop a calculator APP that can perform four arithmetic operations: addition + , subtraction -
Extra Credit try if you have extra time
Develop a calculator APP that can perform four arithmetic operations: addition
subtraction multiplication and division The GUI should look the same as the example
below.
A user can enter floating numbers and operations by clicking the
Buttons with corresponding digits, period, or operations. The
expression will showupdate at the top Label of the APP after
each button is clicked.
When the Button is clicked, the expression will be evaluated
to show the result.
The Button "CLEAR" will clear the display.
In addition, your program should be able to handle following error conditions:
when a user input starts with an operator, your code should add a zero before it For
example, the user starts with an empty display, then clicks the display should show:
when a user enters several operators, only the last one is shown and used. For example,
the user enters then then the display should show:
when a user finishes the expression with an operator, and then clicks the last
operand will be repeated. For example, the user enters the expression will
be changed to for evaluation.
HINT: you can try the function eval to evaluate an arithmetic expression, eg If the display
shows the string STR calling evalSTR will evaluate the expression and
give the result of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
