Question: Using C++ programming language, the user should use reference and pointer types to swap two double precision floating-point numbers. The two numbers are read in
Using C++ programming language, the user should use reference and pointer types to swap two double precision floating-point numbers. The two numbers are read in by the program's user. Use a proper prompt for each number. All the user's inputs must be provided in the main or driver function.
a.In the main get the first two values from the user of the programthen display them.
b.Use one function that uses formal parameter reference types to swap the above first two numbers then display the result of swapping these first two values.
c.To avoid functional side effect on the next function call (Part d) below), prompt the user again to enter two new values then display these two new values. Hint: use the same variables as in Part a) which store the two new values.
d.Use another function that uses formal parameter pointer types to swap the two new numbers then display the result of swapping these two new values.
e.All the displays must be done in the main function. The two functions should only accomplish the swapping with no display.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
