Chapter 13 Quiz

Started: Dec 10 at 6:06pm

Quiz Instructions

This quiz consists of 10 multiple choice questions worth 10 points each. The test is open for one hour and there are two attempts. Good luck!

Note: this is a timed quiz. You may check the remaining time you have at any point while taking the quiz by pressing the keyboard combination SHIFT, ALT, and T… Again: SHIFT, ALT, and T…
?

Question 110?pts

In OOP terminology, an object’s member variables are often called its ________, and its member functions are sometimes referred to as its behaviors, or ________.

?
?
?

Question 210?pts

Examples of access specifiers are the key words:

?
?
?

Question 310?pts

This directive is used to create an “include guard,” which allows a program to be conditionally compiled. This prevents a header file from accidentally being included more than once.) #guard

?
?
?

Question 410?pts

The constructor function’s return type is ________

?
?
?

Question 510?pts

Assuming that Rectangle is a class name, the statement:

???? Rectangle *BoxPtr;

 

?
?
?

Question 610?pts

The constructor function always has the same name as ________.

?
?
?

Question 710?pts

The process of object-oriented analysis can be viewed as the following steps:

?
?
?

Question 810?pts

For the following code, which statement is?not?true?

 

???? class Point

???? {

???? private:

???? ?? double y;

???? ?? double z;

???? public:

???? ?? double x;

???? };

?
?
?

Question 910?pts

What is the output of the following program?

 

???? #include <iostream>

???? using namespace std;

 

???? class TestClass

???? {

???? public:

???? ??? TestClass(int x)

???? ??? { cout << x << endl; }

 

???? ??? TestClass()

???? ??? { cout << “Hello!” << endl; }

???? };

 

???? int main()

???? {

???? ??? TestClass test;

???? ??? return 0;

???? }

 

?
?
?

Question 1010?pts

What is the output of the following program?

 

???? #include <iostream>

???? using namespace std;

 

???? class TestClass

???? {

???? public:

???? ??? TestClass(int x)

???? ??? { cout << x << endl; }

 

???? ??? TestClass()

???? ??? { cout << “Hello!” << endl; }

???? };

 

???? int main()

???? {

???? ??? TestClass test(77);

???? ??? return 0;

???? }