1. 1. This  is required after the closing brace of the structure declaration.

  

a.

  

  

square bracket

  

  

b.

  

  

period

  

  

c.

  

  

semicolon

  

  

d.

  

  

colon

  

  

e.

  

  

None of these

  

     2.   Look at the following statement.

bookList.publisher = ‘t’;

This statement…

  

a.

  

  

is illegal in C++.

  

  

b.

  

  

will change the publisher’s name of the bookList to ‘t’.

  

  

c.

  

  

will store the character ‘t’ in the publisher member of booklist.

  

  

d.

  

  

will ultimately result in a runtime error.

  

  

e.

  

  

None of these.

  

      3   When a structure is passed _________to a function, its members are not copied.

  

a.

  

  

by reference

  

  

b.

  

  

by value

  

  

c.

  

  

Neither of these

  

4. If Circle is a structure tag, the statement

Circle doSomething(Circle c2)

can be the header line for a function that

  

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

  

     5.   Which of the following assigns a value to the hourlyWage member of employee?

  

a.

  

  

Employee.hourlyWage = 50.00;

  

  

b.

  

  

employee2.hourlyWage = 7.50;

  

  

c.

  

  

hourlyWage.employee = 29.75

  

  

d.

  

  

employee.hourlyWage = 100.00;

  

  

e.

  

  

None of these

  

     6.   You may use a structure variable as a

  

a.

  

  

function parameter.

  

  

b.

  

  

function return type.

  

  

c.

  

  

All of these.

  

  

d.

  

  

None of these

  

7. Before a structure can be used, it must be

  

a.

  

  

declared

  

  

b.

  

  

deallocated

  

  

c.

  

  

initialized

  

  

d.

  

  

All of these

  

  

e.

  

  

None of these

  

8. This allows you to access structure members.

  

a.

  

  

structure access operator

  

  

b.

  

  

dot operator

  

  

c.

  

  

#include directive

  

  

d.

  

  

getmember function

  

  

e.

  

  

None of these

  

     9.   A function ___________ return a structure.

  

a.

  

  

may

  

  

b.

  

  

may not

  

  

c.

  

  

will always

  

  

d.

  

  

cannot possibly

  

  

e.

  

  

None of these

  

10. Which of the following statements outputs the value of the gpa member of a  student?

  

a.

  

  

cout

  

  

b.

  

  

cout

  

  

c.

  

  

cout

  

  

d.

  

  

cout

  

  

e.

  

  

None of these

  



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *