Page 1 of 1

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

Posted: Sat May 14, 2022 6:43 pm
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 35 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