Exam 10: Classes and Data Abstraction

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A class is an example of a structured data type.

(True/False)
4.9/5
(30)

By default,all members of a class are ____________________.

(Short Answer)
4.9/5
(29)

In C++,the ____ is an operator called the member access operator.

(Multiple Choice)
4.9/5
(40)

A member function of a class that only accesses the value(s)of the data member(s)is called a(n)____ function.

(Multiple Choice)
4.9/5
(40)

Figure 2: class rectangleType { public: \quad void setLengthWidth(double x, double y); \quad\quad //Postcondition: length = x; width = y; \quad void print() const; \quad\quad //Output length and width; \quad double area(); \quad\quad //Calculate and return the area of the rectangle; \quad double perimeter(); \quad\quad //Calculate and return the parameter; \quad\quad rectangleType(); \quad\quad //Postcondition: length = 0; width = 0; \quad rectangleType(double x, double y); \quad\quad //Postcondition: length = x; width = y; private: \quad double length; \quad double width; }; -Consider the accompanying class definition,and the declaration: rectangleType bigRect; Which of the following statements is correct?

(Multiple Choice)
4.7/5
(39)

A(n)____________________ function of a class changes the values of the member variable(s)of the class.

(Short Answer)
4.8/5
(41)

A program or software that uses and manipulates the objects of a class is called a(n)____________________ of that class.

(Short Answer)
4.9/5
(36)

If a member of a class is ____,you cannot access it outside the class.

(Multiple Choice)
4.8/5
(35)

A class object can be ____.That is,it can be created once,when the control reaches its declaration,and destroyed when the program terminates.

(Multiple Choice)
4.9/5
(32)

Which of the following class definitions is correct in C++?

(Multiple Choice)
4.9/5
(38)

A(n)____________________ is a statement specifying what is true after the function call is completed.

(Short Answer)
4.8/5
(33)

A class object can be ____.That is,it is created each time the control reaches its declaration,and destroyed when the control exits the surrounding block.

(Multiple Choice)
4.9/5
(30)

A(n)____________________ contains the definitions of the functions to implement the operations of an object.

(Short Answer)
4.9/5
(32)

Figure 1: Figure 1:    -Consider the UML class diagram shown in the accompanying figure.Which of the following is the name of the class? -Consider the UML class diagram shown in the accompanying figure.Which of the following is the name of the class?

(Multiple Choice)
4.9/5
(34)

A class and its members can be described graphically using a notation known as the ____ notation.

(Multiple Choice)
4.9/5
(41)

A constructor with no parameters is called the ____________________ constructor.

(Short Answer)
4.9/5
(35)

As parameters to a function,class objects can be passed by reference only.

(True/False)
5.0/5
(31)

Which of the following is true about classes and structs?

(Multiple Choice)
5.0/5
(36)

In C++,you can pass a variable by reference and still prevent the function from changing its value by using the keyword ____ in the formal parameter declaration.

(Multiple Choice)
5.0/5
(34)

If a class object is passed by ____________________,the contents of the member variables of the actual parameter are copied into the corresponding member variables of the formal parameter.

(Short Answer)
4.9/5
(40)
Showing 21 - 40 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)