{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

summary06 - the screen but it does send a kind of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Type_Returned Function_name(Parameter_List); Function_Declaration_Comment Summary Ch 3.3 – 3.4 Chapter 3.3 Programmer-Defined Functions function declaration- describes how a function is used int number_par – formal parameter for variable number return statement- Returns a value of the type of function o in int main() – use return 0; A function definition is like a small program and calling the function is the same thing as running this “small program” A function uses formal parameters, rather than cin , for input. The arguments to the function are the input and they are plugged in for the formal parameters A function (of the kind discussed in this chapter) does not normally send any output to
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the screen, but it does send a kind of “output” back to the program. The function returns a value, which is like the “output” for the function. The function uses a return statement instead of a cout statement for this “output”. Chapter 3.4 Procedural Abstraction • You should treat a function as if you do not need to know the details of how the function works but you should know what it does (black box) • Design your algorithm in steps using pseudocode • Don’t have to use variable _par for formal parameters...
View Full Document

{[ snackBarMessage ]}