Filters
Question type

Study Flashcards

If Circle is a structure tag, then the following statement can be the header line for a function that __________. Circle doSomething(Circle c2)


A) determines and returns the area of a circle
B) takes a Circle structure as a parameter, does something, and returns a Circle structure
C) operates on a constant reference to a Circle structure
D) takes two Circle parameters and does something
E) None of these

Correct Answer

verifed

verified

A function __________ return a structure.


A) may
B) may not
C) will always
D) can never
E) None of these

Correct Answer

verifed

verified

Data types that are created by the programmer are known as


A) variables
B) abstract data types (ADTs)
C) functions
D) parameters
E) None of these

Correct Answer

verifed

verified

To dereference a structure pointer, the appropriate operator is


A) the ampersand (&)
B) an asterisk (*)
C) the -> operator
D) the <- operator (<-)
E) None of these

Correct Answer

verifed

verified

Given the following decaration: Enum Tree { OAK, MAPLE, PINE }; What is the value of the following relational expression? OAK > PINE


A) true
B) False
C) This is an error. You cannot compare enumerators with relational operators.

Correct Answer

verifed

verified

You cannot directly assign an enumerator to an int variable.

Correct Answer

verifed

verified

Any mathematical operation that can be performed on regular C++ variables can be performed on structure members.

Correct Answer

verifed

verified

A struct can contain members with varying data types.

Correct Answer

verifed

verified

You may use a pointer to a structure as a


A) function parameter
B) structure member
C) function return type
D) All of these
E) None of these

Correct Answer

verifed

verified

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;


A) output the dereferenced value pointed to by p
B) result in a compiler error
C) output the address stored in p
D) output the value stored in a
E) None of these

Correct Answer

verifed

verified

Given the structure definition shown, assume that circle1 and circle2 are variables of the Circle type and their members have been initialized. struct Circle { \quad double centerX; \quad double centerY; \quad double radius; }; Then, is it true or False that the following statement correctly determines whether the two variables' members contain the same data? if (circle1 == circle2)

Correct Answer

verifed

verified

The names of enumerators in an enumerated data type must be enclosed in quotation marks.

Correct Answer

verifed

verified

Which of the following describes only the general characteristics of an object?


A) initialization
B) abstraction
C) detailed specification
D) initiation
E) None of these

Correct Answer

verifed

verified

A structure pointer contains


A) the address of a structure variable
B) the dereferenced address of a structure tag
C) the name and address of the structure tag
D) the address of a structure tag
E) None of these

Correct Answer

verifed

verified

Given the following structure decaration, idNum is struct Employee { String name; Int idNum; };


A) a member
B) an array
C) a tag
D) None of these

Correct Answer

verifed

verified

Which of the following is required after the closing brace of the structure definition?


A) square bracket
B) period
C) semicolon
D) colon
E) None of these

Correct Answer

verifed

verified

Which of the following assigns a value to the hourlyWage member of employee[2]?


A) employee[2] -> hourlyWage = 50.00;
B) employee2.hourlyWage = 7.50;
C) hourlyWage[2].employee = 29.75;
D) employee[2].hourlyWage = 75.00;
E) None of these

Correct Answer

verifed

verified

The following statement __________. bookList[2].publisher[3] = 't';


A) is illegal in C++
B) will change the name of the second book in bookList to 't'
C) will store the character 't' in the fourth element of the publisher member of bookList[2]
D) will result in a runtime error
E) None of these

Correct Answer

verifed

verified

When you use a strongly typed enumerator in C++11 you must prefix the enumerator with the name of the enum followed by the : : operator.

Correct Answer

verifed

verified

The structure pointer operator is used to dereference a pointer to a structure, not a pointer that is a member of a structure.

Correct Answer

verifed

verified

Showing 21 - 40 of 46

Related Exams

Show Answer