Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions