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

1 answer below »
Specifications are on the pdf provided. The program needs to use the stack data structure (like java.util.Stack) to store the intermediate results of inner parentheses and/or the operators.


COP-3337 Programming II Programming Assignment 7 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 − (12 + 33) from 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 − (3 + ((4 − 1) + (12 − 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 (+34) 34 2 + (1 − (3 + ((4 − 1) + (12 − 6)))) −9 1 + (2 − (3 + 4 − (5 + (6 − (7 + (8 − 9)))))) 1 2 Submissions You need to submit a .zip file compressing the Java source file(s) of your program (.java files). 1
Answered 1 days AfterApr 26, 2022

Answer To: COP-3337 Programming II Programming Assignment 7 Knight Foundation School of Computing and...

Roshan answered on Apr 27 2022
101 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