Question: Using C++ Write a basic calculator that works with 3 integer numbers: Ask the user to enter the desired operation first (to be entered as
Using C++ Write a basic calculator that works with 3 integer numbers: Ask the user to enter the desired operation first (to be entered as a single letter or symbol). The possible operations are: 1. a. a' or 'A' for average (sum of the 3 numbers divided by 3, note that the result may include fractional numbers), b. 'm' for the smallest number, c. 'M' for the largest number, d. 'c' or 'C' for the middle number, e 'o'or 'O' for how many of the 3 numbers are odd (not divisible by 2), f. 'e'or 'E' for whether all 3 numbers are equal (the answer would be "all numbers are equal" or "the numbers are not equal" 2. Note that two different symbols may trigger one operation. For example 'a' or 'A will get us the average. Your program must accept both symbols as indicated in If the user input does not match any of the letters above, then print an error message and terminate the program. 3. Next, ask the user to enter the three numbers. The numbers may be positive, negative, or zero. If any input has decimals, your program will truncate the number to make it integer. 4. Execute the requested operation and show the result using exactly 2 fractional number (except for points e and f 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
