Reverse Polish (HP) Style Calculator – Part 3 Solved

40.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


5/5 - (11 votes)

The purpose of this assignment is to build the business calculator using supporting files built in Topics 4 and 5.
•       Create a Java application file named containing a main method by using the and associated files from Topic 5.
•       The application should have one text box for numeric data entry, one text box for numeric display, one text box for error display, and buttons labeled “+”, “-“, “*”, “/”, “dup”, “2dup”, “clr”, “pop” and “push.”
•       The actions of the controls should be as follows.
o       The text box for numeric display should display the top element of the stack, or blank if the stack is empty.
o       The text box for numeric data entry should allow the user to type in a valid numeric value.
o       The text box for error display should display an error message from the previous operation (if any), or be blank if the last operation was successful.

o       The buttons labeled “+”, “-“, “*”, “/”, “dup”, “2dup”, “clr”, and pop should invoke the corresponding methods in ForthStack;  “pop” should remove and discard the top item on the stack, and “push” should push the numeric value in the numeric data entry box onto the stack and clear the numeric data entry box.
o       All button operations should update the display of the top of the stack.
•       The size of the stack used should be four, no more or less, in order to standardize testing.
•       After thoroughly testing the program, submit the,,,,, and files to the instructor.