Question: Need help with this program. Thanks Lab 06 - My First Calculator You will be developing a simple calculator that does the following: 1) A

Need help with this program. Thanks

Lab 06 - My First Calculator

You will be developing a simple calculator that does the following:

1) A welcome message is displayed when the program starts.

2) The program will wait for the user to enter in a basic equation. The equation is in the format of operand operator operand. Example Input: 2+2.

The user may choose to enter decimal values for operands and any one of these four operators may be used to specify the type of calculation.

Hint: Accepting an entire equation on a single line does not require anything special on your part. As long as the cin statements are executed in the proper sequence, the program will accept all of your inputs as one line of input. A char type is required to properly read in the operator.

3) After the user types an equation and presses enter, the program displays the result of the calculation. Example Output: 2+2=4.

4) Finally, the program asks the user if it should accept another equation. If the user enters Y or y, for yes, the program returns to step 2. If N or n is entered, the program quits.

Additional Requirements:

1) Each operation must be implemented by a function. Each function takes in two parameters, one for each operand. When called, the functions perform a calculation on the operands and returns the result. These functions should not perform work other than what is necessary to perform their calculations. Example: Your function that adds two operands together should not display information to the terminal. You may choose to create other functions beyond the required ones. There is no restriction on the actions your other functions may perform.

2) The program must be able to handle decimal values entered by the user.

3) When prompted for a letter, the program must accept the uppercase and lowercase variants

. 4) Input error checking is not required. Operator Action + Adds the two numbers together - Subtracts the first number from the second number * Multiplies the two numbers / Divides the first number by the second number

Example Output:

This program is a basic calculator.

Example Input: 2+2

Example Output: 2+2=4

5*2

5*2=10

Again (Y/N):Y

5/2

5/2=2.5

Again (Y/N):y

2.2*2

2.2*2=4.4

Again (Y/N):y

180-30

180-30=150

Again (Y/N):n

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!