Question

1. When is a variable declared inside a function body in scope? a) within the body...

1. When is a variable declared inside a function body in scope?

a) within the body of that function

b) within that body of that function and all the functions it calls

c) from the variable declaration to the end of the source code file

d) everywhere in the source code file

2. Any subset of function parameters in any order may be given default arguments. (True or False)

3. Which of the following details is not used to distinguish the parameter lists of an overloaded function identifier?

a) parameter names (identifiers)

b) parameter number

c) parameter type(s)

d) parameter order

4. A stub is a function whose signature matches a "real" function but whose definition is trivial or incomplete; this lets a stub stand in for the actual function during development or testing. (True or False)

5. A driver is a program which replaces "real" program logic with pre-determined actions that invokes specific functions during development or testing. (True or False)

Homework Answers

Answer #1

1.

a) within the body of that function

If a variable is declared inside a function , its scope is only inside that function.

2.

False

If a parameter is declared default, its subsequent parameters must have default arguments.

3.

a) parameter names (identifiers)

parameter names can be different. Example:

int x,y,m,n;

x = 5;

y = 4;

m = 3;

n = 8;

add(x,y);

add(m,n);

Both the above function calls will call the same function add() with two int arguments.

4.

True

5.

True

Do ask if any doubt.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please answer True or False 1.) SLOC – source lines of code is an effective measure...
Please answer True or False 1.) SLOC – source lines of code is an effective measure of a programmers performance. 2.) In C, for variables declared as static within a function   their values cannot be changed later, after the point of their declaration. 3.) In C, a function can be accessed from outside the file where it is defined. 4.) With the const qualifier, we can protect the value pointed to by a pointer from being modified by the called...
Getting the following errors: Error 1 error C2436: '{ctor}' : member function or nested class in...
Getting the following errors: Error 1 error C2436: '{ctor}' : member function or nested class in constructor initializer list on line 565 Error 2 error C2436: '{ctor}' : member function or nested class in constructor initializer list on line 761 I need this code to COMPILE and RUN, but I cannot get rid of this error. Please Help!! #include #include #include #include using namespace std; enum contactGroupType {// used in extPersonType FAMILY, FRIEND, BUSINESS, UNFILLED }; class addressType { private:...
this is the book name. Data Structures and Abstractions with Java 1) Description: The sample programs...
this is the book name. Data Structures and Abstractions with Java 1) Description: The sample programs in Chapter 1 of your textbook are not complete. They are used for illustration purpose only. The implementation of Listing 1-1 on page 39 is explained in Chapter 2. And, in order to see the result of using it, we will need the following set of files: i. BagInteface.java – the specification only. ii. ArrayBag.java – the implementation of BagInerface.java. iii. ArrayBagDemo.java – a...
IntList Lab Specifications You are required to come up with a single header file (IntList.h) that...
IntList Lab Specifications You are required to come up with a single header file (IntList.h) that declares and implements the IntNode class (just copy it exactly as it is below) as well as declares the IntList Class interface only. You are also required to come up with a separate implementation file (IntList.cpp) that implements the member functions of the IntList class. While developing your IntList class you must write your own test harness (within a file named main.cpp). Never implement...