Problem: Using passing by value or by reference, create the following four functions/procedures: void displayMenu(); int

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Problem: Using passing by value or by reference, create the following four functions/procedures: void displayMenu(); int

Post by answerhappygod »

Problem Using Passing By Value Or By Reference Create The Following Four Functions Procedures Void Displaymenu Int 1
Problem Using Passing By Value Or By Reference Create The Following Four Functions Procedures Void Displaymenu Int 1 (112.48 KiB) Viewed 33 times
C++ please !
Problem: Using passing by value or by reference, create the following four functions/procedures: void displayMenu(); int largest(int a, int b, int c); void mySort(int& a, int& b, int& c); void myPermutation(int& a, int& b, int& c); where displayMenu prints a list of options to the console, largest returns the largest value among three input integers, mySort sorts the three integers in ascending order, and myPermutation applies a permutation to the numbers (that is, a list of numbers 1 2 3 will become 3 1 2 after the function call). Your main function should take in three integers from the user, and then continuously display a menu of options and call the corresponding function based on the user input until the user enters Q or a. . About: : This permutation is just putting the last number to the front, not random. • You may assume that the user always provides valid input. . You may not use any library other than <iostream> A sample run of your code may look like: Enter your three integer numbers: 3 5 4 ==== MENU ================== 1. Output the largest 2. Get the next permutation 3. Sort in ascending order Enter your choice (1 - 3), Q to quit: 1 The largest number among the three is: 5 EEEEEEEEEEE == ================== MENU 1. Output the largest 2. Get the next permutation 3. Sort in ascending order Enter your choice (1 - 3), Q to quit: 3 After sorting: 3 4 5 ================== MENU ================ 1. Output the largest 2. Get the next permutation 3. Sort in ascending order Enter your choice (1 - 3), Q to quit: 2 After one permutation: 5 3 4 *****mas MENU ====== MENU ================== 1. Output the largest 2. Get the next permutation 3. Sort in ascending order Enter your choice (1 - 3), Q to quit: 2 After one permutation: 4 5 3 EEEEEEEEEEEE ================== MENU 1. Output the largest 2. Get the next permutation 3. Sort in ascending order Enter your choice (1 - 3), Q to quit: Q Exit the menu
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply