Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

COP-3337 Programming II Programming Assignment 6 Knight Foundation School of Computing and Information Sciences In this assignment, you implement a simple calculator supporting integer values with...

1 answer below »

COP-3337 Programming II
Programming Assignment 6
Knight Foundation School of Computing and Information Sciences
In this assignment, you implement a simple calculator supporting integer values with
only two operations addition and subtraction. The program receives an expression like
95 − XXXXXXXXXXfrom the keyboard and prints out the result (50 in this case) on the screen.
Please note that the input expression may include nested parentheses like
2 + (1 − XXXXXXXXXX − XXXXXXXXXX − 6))))
Therefore, your program needs to use the stack data structure (like java.util.Stack) to store
the intermediate results of inner parentheses and/or the operators.
1 Sample Input/Output
Here are some examples of how your program should operate:
input expression output
((2)) 2
−0022 −22
−(2 − 3 − 4) 5
XXXXXXXXXX
2 + (1 − XXXXXXXXXX − XXXXXXXXXX − 6)))) −9
1 + (2 − (3 + 4 − XXXXXXXXXX − XXXXXXXXXX − XXXXXXXXXX
2 Submissions
You need to submit a .zip file compressing the Java source file(s) of your program (.java
files).
1
Answered Same Day Jul 22, 2022

Solution

Uhanya answered on Jul 23 2022
72 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here