Question: 26.4 Modular Programming Write a program that displays the sum, product or difference of two numbers entered from the keyboard. The program should be menu

 26.4 Modular Programming Write a program that displays the sum, product

26.4 Modular Programming Write a program that displays the sum, product or difference of two numbers entered from the keyboard. The program should be menu driven, asking the user for sp or d. The user should then be asked to enter two numbers and your program will display the appropriate result based on user's menu choice. Write the main function in the program as follows: Declare appropriate variables Call function display Menu that displays the menu of choices., reads the choice and returns the choice to main Call a function getData that receives two integer variables, asks the user for two integers and using passing by reference returns those values to main Call a function display that receives the user's choice, the two integers entered by the user. The function definition should contain a switch statement that uses the user's choice and the two integers passed to the function to calculate the appropriate result. The last line of the function should display the result. 293816.150 1062 LAB ACTIVITY 26.4.1: ModularProgramming 0/10 main.cpp Load default template... 1 #include 2 using namespace std; 3 void getData (int &, int &); 4 char displayMenu(); 5 void display(char, int, int); 6 int maino { int x,y; char choice; 9 choice - displayMenu(); 10 getData (x,y); 11 display(choice,x,y); 127 13 // write your functions here

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!