Question
Write an integer calculator. This should be able to handle +, -, / (integer division), and *(integer multiplying) until a '#' character is reached instead
Write an integer calculator. This should be able to handle +, -, / (integer division), and *(integer multiplying) until a '#' character is reached instead of an operation. Ignore order of operations as well, and always assume the left operations are done first. For eample: 2+3/5 = 5/5 = 1. You should then show the result (you do not need to show the original equation). As this is an integer calculator you may assume they enter only integers and valid operations (or the stopping character). Detect an error if you enter just a '#'.
Example 1(user input is underlined):
Enter an equation: 2+3*2#
10
Example 2 (user input is underlined):
Enter an equation: 2+3*2/5000+94#
5
Example 3 (user input is underlined):
Enter an equation: 2/3#
0
Example 4 (user input is underlined):
Enter an equation: 7#
7
Example 5 (user input is underlined):
Enter an equation: #
Error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started