Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago