Question: (in c++, can this be done using the if - else if? I would really appreciate if comments were added to explain the logic) Calculator

(in c++, can this be done using the if - else if? I would really appreciate if comments were added to explain the logic)

Calculator program helps users to do basic math operations. The operations only include addition, subtraction , multiplication, division, and modulus. Create a menu where the users will be asked to select one of the operations. The final selection on the menu should let the user eXit the program. The user will be asked to enter the math operation and 2 integer values. The program will display the answer after the selected operation. After the user has finished the math problem, the program should display the menu again. The process must repeat until the user chooses to quit the program. At the end, the program will display how many attempts were made by user. If the user selects an item not on the menu, the program should print an error message and then display the menu again.

*expected output below*

Arithmetic Calculator

Written by:

Date:

-----------------------------------------------------------

Enter student name:

Calculator

------------------------------------------

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulus

X eXit

------------------------------------------

Enter your selection *

You have selected: Multiplication

Enter 1st value: 1

Enter 2nd value: 2

Answer: The product of 1 and 2 is 2

Calculator

------------------------------------------

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulus

X eXit

-----------------------------------------

- Enter your selection /

You have selected: Division

Enter 1st value: 1

Enter 2nd value: 0

Answer: Sorry Cannot divide by zero

Calculator

------------------------------------------

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulus

X eXit

------------------------------------------

Enter your selection x

------------------------------------------

Users Summary

------------------------------------------

, you have attempted 2 times.

--------------------------------------------------------------

End of Project

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!