Filters
Question type

Study Flashcards

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) class studentType
{
public:
\quad void setData(string, double, int) ;
private:
\quad string name;
};
B) class studentType
{
public:
\quad void setData(string, double, int) ;
\quad void print() const;
private:
\quad string name;
\quad double gpa;
}
C) class studentType
{
public void setData(string, double, int) ;
private string name;
};
D) studentType class
{
public: void setData(string, double, int) ;
private: string name;
};

Correct Answer

verifed

verified

In C++ terminology, a class object is the same as a class instance.

Correct Answer

verifed

verified

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


A) .
B) ,
C) ::
D) #

Correct Answer

verifed

verified

What does ADT stand for?


A) abstract definition type
B) asynchronous data transfer
C) abstract data type
D) alternative definition type

Correct Answer

verifed

verified

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


A) rectangle rectangleType;
B) class rectangleType rectangle;
C) rectangleType rectangle;
D) rectangle rectangleType.area;

Correct Answer

verifed

verified

  -Consider the UML class diagram shown in the accompanying figure. Which of the following is the name of the class? A)  clock B)  clockType C)  Type D)  +clockType -Consider the UML class diagram shown in the accompanying figure. Which of the following is the name of the class?


A) clock
B) clockType
C) Type
D) +clockType

Correct Answer

verifed

verified

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


A) rectangleType.print() ;
B) rectangl
C) bigRect.print() ;
D) bigRect::print() ;

Correct Answer

verifed

verified

A C++ implementation file has the extension ____________________.

Correct Answer

verifed

verified

To create the object code file for any source code file, the command line option ____________________ is used on the system command line.

Correct Answer

verifed

verified

A constructor with no parameters is called the ____________________ constructor.

Correct Answer

verifed

verified

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


A) static
B) automatic
C) local
D) public

Correct Answer

verifed

verified

Classes were specifically designed in C++ to handle ____________________.

Correct Answer

verifed

verified

abstract d...

View Answer

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

Correct Answer

verifed

verified

The header file is also known as the ____________________.

Correct Answer

verifed

verified

interface ...

View Answer

To guarantee that the member variables of a class are initialized, you use ____.


A) accessors
B) mutators
C) constructors
D) destructor

Correct Answer

verifed

verified

  -Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many private members are in the class? A)  none B)  zero C)  two D)  three -Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many private members are in the class?


A) none
B) zero
C) two
D) three

Correct Answer

verifed

verified

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


A) OON
B) OOD
C) UML
D) OOP

Correct Answer

verifed

verified

If an object is created in a user program, then the object can access both the public and private members of the class.

Correct Answer

verifed

verified

Showing 21 - 40 of 49

Related Exams

Show Answer