Question: Write a calculator program that does addition, subtraction, multiplication and division. ANSWER IN C LANGUAGE ! Use the algorithm provided below to help create your

Write a calculator program that does addition, subtraction, multiplication and division. ANSWER IN C LANGUAGE ! Use the algorithm provided below to help create your C program:

Algorithm for simple 4-function calculator:

Inputs: (from user or file or wherever)

User provides the operation and two operands

Outputs: (text description of what the algorithm will output)

Program outputs the results of the operation.

Relevant Constants and Formulas:

Main Algorithm (numbered steps)

1. Print welcome message 2. Prompt the user for the operation 3. Perform correct operation 4. Output result to user

Step 3 has four variations, depending on the operation selected by the user.

3a Addition 3a. 1 prompt the user for the two operands to be added 3a. 2 return the sum of the two operands

3b Subtraction 3b. 1 prompt the user for the first operand (Minuend) 3b. 2 prompt the user for the second operand (Subtrahend) 3b. 3 return the difference (Minuend - Subtrahend)

3 Multiplication 3c. 1 prompt the user for the two operands to be multiplied 3c. 2 return the product of the two

3d Division 3d .1 prompt the user for the dividend 3d .2 prompt the user for the divisor 3d .3 check to ensure the divisor is not 0 3d .4 return the quotient of dividend/divisor

Will give good rating if solved correctly !

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!