Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 18 pages
Class notes

EOC STUDY GUIDE Final notes

Document preview thumbnail
Preview 3 out of 18 pages

Part 2 of study guide notes

Content preview

EOC STUDY GUIDE PT.2
Functions
1. A collection of statements that performs a specific task is a(n)
a. infinite loop
b. variable
c. constant
d. function
e. decision

2. A function __________ contains the statements that make up the function.
a. prototype
b. definition
c. call
d. expression
e. parameter list

3. A function can have no parameters, one parameter, or many parameters and can return
__________ value(s).
a. zero to many
b. no
c. only one
d. a maximum of ten
e. None of these

4. A function is executed when it is
a. defined
b. prototyped
c. declared
d. called
e. None of these

5. This type of variable is defined inside a function and is not accessible outside the
function.
a. global
b. reference
c. local
d. counter

, e. None of these

6. The value in this type of variable persists between function calls.
a. global
b. internal
c. static
d. dynamic
e. None of these

7. When used as parameters, these types of variables allow a function to access the
parameter's original argument:
a. reference
b. floating-point
c. counter
d. undeclared
e. None of these

8. __________ functions may have the same name as long as their parameter lists are
different.
a. Only two
b. Two or more
c. No
d. Un-prototyped
e. None of these

9. This statement causes a function to end.
a. end
b. terminate
c. return
d. release
e. None of these

10. A function _________ eliminates the need to place a function definition before all calls to
the function.
a. header
b. prototype
c. argument
d. parameter
e. None of these

, 11. If a function is called more than once in a program, the values stored in the function's
local variables do not _________ between function calls.
a. persist
b. execute
c. communicate
d. change
e. None of these

12. If a function does not have a prototype, default arguments may be specified in the
__________.
a. function call
b. function header
c. execution
d. return type
e. None of these

13. Given the following function:
void calc (int a, int& b)
{int c;
c = a + 2;
a = a * 3;
b = c + a;}
What is the output of the following code segment that invokes calc():
int x = 1;
int y = 2;
int z = 3;
calc(x, y);
cout << x << " " << y << " " << z << endl;
a. 1 2 3
b. 1 6 3
c. 3 6 3
d. 1 14 9
e. 2 3 4 5

14. What will the following code display?
#include <iostream>
using namespace std;
void showDub(int);
int main()
{int x = 2;

Document information

Uploaded on
August 12, 2024
Number of pages
18
Written in
2024/2025
Type
Class notes
Professor(s)
Charles braun
Contains
All classes
$6.59

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
5
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions