Question: Write a short program in C++ with the following characteristics: 1) It contains a function called input that requests two values of type double from
Write a short program in C++ with the following characteristics:
1) It contains a function called "input" that requests two values of type double from the user and "returns" them both to main. Do not use an array or struct.
2) It contains a function called "swapVal" that requires two values of type double and swaps them, so that the value stored in the first argument ends up in the second argument and the value stored in the second argument ends up in the first argument.
3) It contains a function called "output" that prints two values of type double to the screen with a space between them.
4) Main calls the functions in this order: input, output, swap, output each with the appropriate arguments.
Full program documentation is not needed for this exercise, but be sure to include the correct documentation for the functions as well as your name and file name at the top of the source code file. Use correct indentation and spacing.
You must name your file lab3.cpp
Documentation:
Review ProgrammingProcess1230.pdf (see #5 and #7)
Write function documentation for main, input, swapVal, and output functions.
Sample submission:
// Name
// File name
// Date
// Purpose
// Input
// Process
// Output
void myFunction(int);
// description of purpose
// In:
// Modify:
// Output:
etc...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
