Question: Language is C++ (Part B) : Pass by value versus pass by reference 40 points Write a C++ program which prompts user to choose from
Language is C++
(Part B) : Pass by value versus pass by reference 40 points
Write a C++ program which prompts user to choose from the two alternative funtions specified below, each of which returns a random message.
The two functions are:
- Function messageByValue that returns the message by value and
- Function messageByReference that returns the message by reference.
Each function returns one of four random messages:
- Sorry. Youre not close enough! returned 20% of the time
- Oh, youre almost there? returned 40% of the time
- Aw cmon, you can do better than that! returned 25% of the time
- Youre up big. Getting closer to breaking your old record returned 15% of the time
NOTE:
Use a while loop to continually run program until a -1 is entered to Terminate program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
