CH 11 - C++

25 July 2022
4.7 (114 reviews)
25 test answers

Unlock all answers in this set

Unlock answers (21)
question
Passing a structure as a constant reference parameter to a function:
answer
guarantees not to result in changes to the structure's members
question
Which of the following assigns a value to the hourlyWage member of employee[2]?
answer
employee[2].hourlyWage = 100.00;
question
This describes only the general characteristics of an object
answer
abstraction
question
Data types that are created by the programmer are known as:
answer
abstract data types (ADT)
question
A structure _____________ contain members of the same data type
answer
can
question
Look at the following statement. The statement ______. bookList[2].publisher[3] = 't';
answer
will store the character 't' in the fourth element of the publisher member of booklist[2].
question
A good reason to pass a structure as a constant reference is:
answer
to prevent changes to the structure members
question
If a is a structure variable and p, a pointer, is a member of the structure, what will the following statement do? cout << *a.p;
answer
Output the dereferenced value pointed to by p
question
A structure pointer contains:
answer
The address of a structure variable
question
If Circle is a structure tag, the statement Circle *pcirc;
answer
declares a structure pointer called pcirc
question
If Circle is a structure tag, the statement can be the header line for a function that ____.
answer
takes a Circle structure as a parameter, does something, and returns a Circle structure
question
Before a structure can be used, it must be
answer
declared
question
This allows you to access structure members.
answer
dot operator
question
Which of the following statements outputs the value of the gpa member of element 1 of the student array?
answer
cout<
question
If an anonymous union is declared globally (outside all functions), it must be:
answer
declared static
question
A function ___________ return a structure
answer
may
question
When a structure is passed _________to a function, its members are not copied.
answer
by reference
question
With an enumerated data type, the enumerators are stored in memory as
answer
integers
question
This is required after the closing brace of the structure declaration.
answer
semicolon
question
Members of a(n) ________ union have names, but the union itself has no name.
answer
anonymous
question
This is like a structure, except all members occupy the same memory area
answer
union
question
Which of the following is an example of a C++ primitive data type?
answer
unsigned short int long double unsigned char All of these
question
You may use a pointer to a structure as a
answer
function parameter. structure member. function return type. All of these
question
The name of the structure is referred to as its
answer
tag
question
To dereference a structure pointer, the appropriate operator is:
answer
the structure pointer operator, ->