Question: Using C++ CALCULATE.CPP You will write a program that mimicks a simple calculator that can do adding, multiplication, or modulo of 2 integers. The program
CALCULATE.CPP You will write a program that mimicks a simple calculator that can do adding, multiplication, or modulo of 2 integers. The program takes 3 arguments at the command line: an integer, a character, and another integer. The character can be one of only 3 types:"+"X, or %. The program then returns either the sum, the product, or the modulo of the 2 integers. The program should be able to verify that 1) the user has exactly 3 arguments. 2) the operator used is one of the 3 allowed operators and nothing else. 3) when using modulo, the second integer is not zero (otherwise, you would divide by zero)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
