Write a C++ program that performs basic arithmetic operations including addition, subtraction,multiplication, division, and modulus. Normally, when we work with calculators, we would enter the expressionand press the "=" button to see the result. In this project, it will be done differently. The expressions areprovided an input file and your calculator is supposed to read them from there and perform the calculation. Your program should treat the first term as a number, the second term as a character, the third term as anumber. This approach will pose a problem if the expression is malformed; therefore, you must include amechanism to check the data type. The following operators must be supported.
Write a C++ program that performs basic arithmetic operations including addition, subtraction,
multiplication, division, and modulus. Normally, when we work with calculators, we would enter the expression
and press the "=" button to see the result. In this project, it will be done differently. The expressions are
provided an input file and your calculator is supposed to read them from there and perform the calculation.
Your program should treat the first term as a number, the second term as a character, the third term as a
number. This approach will pose a problem if the expression is malformed; therefore, you must include a
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images