In your own words discuss similarities and differences between a function and a small program.

What will be an ideal response?

A function definition is like a small program. Differences are that a program uses
input, say cin, for input, or an fstream object, whereas a function uses parameters
for inputs. Similarities are many. A program uses cout for output to the screen. A
function can use cout to output to the screen. The function can return a value to the
caller using a return statement. The program can, in fact, do this too, but such
values can only be success codes. The function and the program each have bodies of
code that call other functions and do computation to produce the values to satisfy
specified. Each has local variables that are declared within the body. Finally, each can
use global constants and variables (which are declared outside any function.)

Computer Science & Information Technology

You might also like to view...

Using the ________ tab on the File tab you can share your presentation files in a variety of ways, depending on whether or not your presentation file is saved locally, on a SharePoint site, or on SkyDrive

Fill in the blank(s) with correct word

Computer Science & Information Technology

To ensure that a macro works as expected after the macro has been created and assigned a button or menu item, it should be ________

A) viewed B) saved C) protected D) tested

Computer Science & Information Technology