Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt 5 1 4 . ( CFD )

Answered: 1 week ago