Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. Function messageByValue that returns the message by value and
  2. Function messageByReference that returns the message by reference.

Each function returns one of four random messages:

  1. Sorry. Youre not close enough! returned 20% of the time
  2. Oh, youre almost there? returned 40% of the time
  3. Aw cmon, you can do better than that! returned 25% of the time
  4. 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

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions