Exam 6: Using C++ Functions
Exam 1: An Overview of Object-Oriented Programming and C++55 Questions
Exam 2: Evaluating C Expressions51 Questions
Exam 3: Making Decisions50 Questions
Exam 4: Performing Loops51 Questions
Exam 5: Understanding Arrays, Strings and Pointers55 Questions
Exam 6: Using C++ Functions51 Questions
Exam 7: Using Classes56 Questions
Exam 8: Class Features and Design Issues53 Questions
Exam 9: Understanding Friends and Overloading Operators52 Questions
Exam 10: Understanding Inheritance53 Questions
Exam 11: Using Templates54 Questions
Exam 12: Handling Exceptions51 Questions
Exam 13: Advanced Input and Output55 Questions
Exam 14: Advanced Topics53 Questions
Select questions type
Describe two benefits of using structures with functions (either as arguments or a return type)?
Free
(Essay)
4.9/5
(32)
Correct Answer:
When you use structures with functions, you get at least two benefits. First, when you group individual fields into a structure, it is easier to pass them all into a function as a unit. Without structures, you would have to pass in each of the individual fields separately. Second, when you return a structure from a function, you can pass back a group of values; because only one value can be returned from a function, there would be no way to return all the field values separately.,
Write an example of code that illustrates how to use the scope resolution operator.
Free
(Essay)
4.8/5
(41)
Correct Answer:
#include
using namespace std;
int age = 30;
int main()
{
int age = 45;
cout ,
Match each term with the correct statement below.
Premises:
statement that notifies the calling function that the definition (details) of the named function will come later
Responses:
overhead
subfunction
ambiguity
Correct Answer:
Premises:
Responses:
Free
(Matching)
4.9/5
(42)
Correct Answer:
The statement that executes a function is the function ____.
(Multiple Choice)
4.9/5
(28)
Match each term with the correct statement below.
Premises:
device that you cannot look into to discover how it works but that works nonetheless
Responses:
black box
inline function
encapsulation
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(31)
____ a function name involves creating multiple functions with the same name but different parameter lists.
(Multiple Choice)
4.7/5
(40)
The principle of ____ is a programming principle that says you should give a process only the authority it needs to accomplish its job.
(Multiple Choice)
4.8/5
(38)
A(n) ____ value is a value sent from a subfunction to the function that called it.
(Multiple Choice)
4.9/5
(34)
When you use a(n) ____ function, a copy of the function statements is placed directly into the compiled calling program.
(Multiple Choice)
4.8/5
(33)
The ____ of a variable is the time during which it is defined-from declaration to destruction.
(Multiple Choice)
4.7/5
(38)
____ variables are those that are known to all functions in a program.
(Multiple Choice)
4.8/5
(39)
Match each term with the correct statement below.
Premises:
principle of containing variables locally in their functions
Responses:
abstraction
ambiguity
encapsulation
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(38)
A variable that acts as an alias for another variable is called a ____ variable.
(Multiple Choice)
4.9/5
(28)
Any variable listed in a function header is known as a(n) ____ parameter.
(Multiple Choice)
4.8/5
(36)
The statement return letter; can be alternatively written as ____. Both statements work identically.
(Multiple Choice)
4.9/5
(34)
When you declare a pointer, you insert a(n) ____ in front of the variable name.
(Multiple Choice)
4.8/5
(43)
List some advantages and disadvantages of passing an address of a variable to a function.
(Essay)
4.9/5
(39)
Showing 1 - 20 of 51
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)