Course Solutions Uncategorized (Solved) : Create Simple Calculator Program Program Receive String Input Begin Number Finish End Equa Q29470900 . . . .

(Solved) : Create Simple Calculator Program Program Receive String Input Begin Number Finish End Equa Q29470900 . . . .

 

Create a simple calculator program. The program will receive aString input which begin with a number and finish/end with anequation mark/character: ‘=‘ Assume that user will always give acorrect input Reject input that do not begin with number and endingwith ‘=‘ The program need to have these behavior: Can not havebracket ‘( )’ Do not follow hierarchy order of calculation,calculation will always start from left to right, regardless of theoperation type.

———————————–

Example: Input: “1+2-3*4/5=“

Output: 0

Input: “2+4/3”

Output: Exception(error)

Example:

Input: “(2+3)+4“

Output: Exception(error)

Input: “2+4/3=”

Output: 2

Input: “2+-5+4=”

Output: Exception(error)

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post