Teacher Name:Mr. Rung Date of Lesson: January
Course Name: C++ Lesson Name: Chap 12.3ab
Student Name
Password
Objective To complete the wokbook exercises.
Primary Focus Answer the questions below.
Site Links Course Home Page
Additional Resources
Site Links
Question #1
Classes are normally defined in header files so that they may be reused.
True False
Question #2
In general, header files contain declarations of variables, functions, classes, and the implemen- tation of the functions and classes.
Question #3
If the semicolon after a class definition is omitted, the compiler will report several errors.
Question #4
Member functions allow programmers to send information to the class and receive information.
Question #5
Constructors build an entire program based on a given class.
Question #6
What is the purpose of the #ifndef and #define compiler directives which appear at the top of files with class definitions?
A: allow the data to be accessible from an outside object B: are optional C: prevent a class from being defined twice in the same program. D: add to the scope of the class E: None of these
Question #7
What information is placed after the public keyword in a class definition?
A: compiler directives B: encapsulated data C: functions and data that are not to be accessible from outside the object D: functions and data that are to be accessible from outside the object E: None of these
Question #8
What information is placed after the private keyword in a class definition?
Question #9
When is a copy constructor used ?
A: when an object is passed by reference B: when an object is passed by value C: to expand the scope D: for any instace of a class E: None of these
Question #10
When implementing a member function like the one shown below, a special operator (::) is necessary. What is the name of this special operator? // Method to find the area of the circle double circle::Area() { return(PI*radius*radius); }
A: resolution operator B: class operator C: method operator D: All the above E: None of these