Develop a complete C++ program to perform the following
tasks:
- Implement a function that takes three parameters (x, y, z). It
calculates minimum of x and y, and keeps the result in z. Return
type of this function is void.
- Implement a function that takes three parameters (x, y, z). It
calculates max of x and y, and keeps the result in z. Return type
of this function is void.
- Implement a function that takes three parameters (x, y, z). It
calculates ave of x and y, and keeps the result in z. Return type
of this function is void.
Design a loop in which you ask user to enter two numbers and
calculation. User enters only number between 0 and 100. Perform
intended calculation until user enters 0 and 0 as operators. An
example run given as
Enter two numbers: 2 5
Enter an operation 1)min 2)max 3)ave : 2
Max of 2 and 5 is 5.
Enter two numbers: 8 65
Enter an operation 1)min 2)max 3)ave : 1
Min of 8 and 65 is 8.
Enter two numbers: 16 20
Enter an operation 1)min 2)max 3)ave : 3
Ave of 16 and 20 is 18.
Enter two numbers: 40 50
Enter an operation 1)min 2)max 3)ave : 3
Ave of 40 and 50 is 45.
Enter two numbers: 0 0
Bye…
Note: Make sure that you get numbers from the user at once, such as cin >> a >> b;
#include <iostream>
using namespace std;
void Min(int x,int y,int z);
void Max(int x,int y,int z);
void Ave(int x,int y,int z);
int main() {
int op,num1,num2,Result=0;
cout<<"Enter an operation: "<<endl;
cout<<"1.Min"<<endl;
cout<<"2.Max"<<endl;
cout<<"3.ave"<<endl;
cout<<"Enter the two numbers: "<<endl;
cin>>num1>>num2;
while(num1!=0 && num2!=0)
{
cin>>op;
switch(op)
{
case 1:Min(num1,num2,Result);
break;
case 2:Max(num1,num2,Result);
break;
case 3:Ave(num1,num2,Result);
break;
}
cout<<"Enter an operation: "<<endl;
cout<<"1.Min"<<endl;
cout<<"2.Max"<<endl;
cout<<"3.ave"<<endl;
cout<<"Enter the two numbers: "<<endl;
cin>>num1>>num2;
}
cout<<"Bye Bye"<<endl;
}
void Min(int x,int y,int z)
{
if(x<y)
z=x;
else
z=y;
cout<<"Min of "<<x <<"and "<<y<<"
is "<<z<<endl;
}
void Max(int x,int y,int z)
{
if(x>y)
z=x;
else
z=y;
cout<<"Max of "<<x <<"and "<<y<<" is
"<<z<<endl;
}
void Ave(int x,int y,int z)
{
z=(x+y)/2;
cout<<"Ave of "<<x <<"and "<<y<<" is
"<<z<<endl;
}

Develop a complete C++ program to perform the following tasks: - Implement a function that takes...
Write a Java program which allows the user to perform simple tasks on a calculator. A series of methods allows the user to select an operation to perform and then enter operands. The first method displays a menu, giving the user the choice of typing in any one of the following: +, -, *, /, or % representing the usual arithmetic operators (Each operation should be done on numbers negative(-) to positive(+), positive(+) to negative(-), negative(-) to negative(-), and positive(+)...
Develop a complete C++ program that will calculate draw an empty cube rectangle using a function call. A rectangle is identified by length of its edges, 2 <= L <= 20. Implement a function to perform user request, which requires two parameter. The functions you define should not return a value. In main() function, design a loop to ask user to enter length of edges until user enters 0 for one of the edges. A length of 0 exits the...
Complete a partially written C++ program that includes a function that return a value. The program is a simple calculator that prompts the user of 2 number and an operation (+, -, * or, /). The two number and the operator are passed to the function where the appropriate arithmetic operation is performed. The result is return to the main function () where the arithmetic operation and result are displayed. For example 3 * 4 = 12 The source code...
Write a C++ program that contains a function called swapNums. This function takes two integer parameters, swaps them in memory, and outputs the results (there is nothing to return). In main, ask the user to enter two different numbers, output them as entered (step 1), call the function swapNums() which will output the numbers swapped (step 2), and then output the values again in main (step 3). You should have three sets of output. Sample run (10 and 5 were...
Problem 6 Implement a MATLAB function bisection.m of the form bisection(a, b, f, p, t) function [r, h] % a Beginning of interval [a, bl % b: End of interval [a, b] % f: function handle y f(x, p) % p: parameters to pass through to f % t: User-provided tolerance for interval width At each step j 1 to n, carefully choose m as in bisection with the geometric (watch out for zeroes!) Replace [a, b] by the smallest...
Question 19 4 pts Using the program below, please complete the program by adding 2 functions as follow: 1. A function named getAverage that calculates and returns the Average. 2. A function named getMaximum that returns the maximum of the three numbers. Make sure to use the proper data types for all variables and functions. #include <iostream> using namespace std; //function getAverage //function getMaximum int main(int argc, char** argv) { int x, y, z; cout << "Enter three whole numbers:...
Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve the following program. -Use Microsoft Visual C++ .NET 2010 Professional compiler using default compiler settings. -Use Microsoft Visio 2013 for developing your flowchart. -Adherence to the ANSI C++ required -Do not use <stdio.h> and <conio.h>. -Do not use any #define in your program. -No goto statements allowed. Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu....
Section 3: Create a Calculator For this problem, please create a "calculator" function that takes two integers and an operator and does the math operation corresponding to the numbers and the operator. For instance, calculate(5,"+", 6) should return 11. Please support the following operators: +- X/^(addition, subtraction, multiplication, division, exponentiation) 1 2 3 function calculate (numi, operator, num2) { // Do the calculation } RUN CODE Parameters Expected Result Actual Result 1,"+", 4 1,"x", 0 20,"7", 5 3,"", 3
Problem 6 Implement a MATLAB function bisection.m of the form bisection (a, b, f, p, t) function [r, h] Beginning of interval [a, b] % b End of interval [a, b] % f function handle y = f(x, p) % p: parameters to pass through to f % t User-provided tolerance for interval width a: At each step j = 1 to n, carefully choose m as in bisection with the geometric (watch out for zeroes!) Replace a, b by...
Need help problem 9-13
C++ Homework please help
WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...