Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment: Working in teams of 2, modify your mini-calculator pro using programmer defined functions for each operation. Recall that the calculator will perform tollowing calculations:

image text in transcribed
Assignment: Working in teams of 2, modify your mini-calculator pro using programmer defined functions for each operation. Recall that the calculator will perform tollowing calculations: "(addition) and "(subtraction). And four more operations of your choosing. Each operation will be represented by a programmer defined function. gram from last week's closed lab the Front Design a C++ menu of these program as a calculator to perform the simple operations of:+ and- by giving the user a 2 operations to choose from. Use a do-while loop to display the menu of the four operations. Open When the user selects an operation such as "+, the user is prompted for the values on which the operation is to be performed. For example, if the user selects the "+" operation then the user is prompted for the values in main0 such as: Find Please input two values to add together: 38 Note: both operations (+, -) are represented in a switch statement. The values, such as 3 and 8 above, will be stored into variables and then passed by call by value as actual parameters to the programmer defined function addTwo(x, y) and stored in the formal parameters. This method applies to all six operations. Within addTwo0, a local variable, sum, is declared to contain the sum of the formal parameters. Sum is then returned to the function call. Note: the function call for addTwo(x, y); must be in an assignment statement and assigned to main)'s variable main sum (or another name but not the same as addTwo(x,y) variable name sum. The value for main sum is then printed in main. The user keys in the operations they wish to perform and the values they wish the operations to The user keys in a "Q" for quit when they want the program to terminate. Input: be performed on. Output: For each operation the user selects, a friendly display and informative output is displayed such as: You specified the following operation and the computed result is: 3+8 11 Test Data: None required

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago

Question

What is Ramayana, who is its creator, why was Ramayana written?

Answered: 1 week ago

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago