Question: Object Oriented Programming C++ Write a complete C++ program with the two alternate functions specified below, each of which simply triples the variable count defined
Object Oriented Programming C++
Write a complete C++ program with the two alternate functions specified below, each of which simply triples the variable count defined in main. In main function, test the two functions by asking the user to input an integer value, save it to a variable, then call the two functions, and display the variable before and after the function calls. Then compare and contrast the two approaches. These two functions are
a) function tripleByValue that passes a copy of count by value, triples the copy and returns the new value. The signature of the function should be: int tripleByValue(int a)
b) function tripleByReference that passes count by reference via a reference parameter and triples the original value of count through its alias (i.e., the reference parameter). The signature of the function should be: void tripleByReference(int a)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
