Content Frame
Note for screen reader users: There is text between the form elements on this page. To be sure that you do not miss any text, use item by item navigation methods, rather than tabbing from form element to form element.
Skip Breadcrumb Navigation
Home  arrow Exercícios de múltipla escolha (em Inglês)  arrow Capitulo 9

Capitulo 9



This activity contains 24 questions.

Question 1.
Section 9.2 Time Class Case Study

9.2 Q1: Member access specifiers (public and private) can appear:

 
End of Question 1


Question 2.
9.2 Q2: Which of the following preprocessor directives does not constitute part of the preprocessor wrapper?

 
End of Question 2


Question 3.
9.2 Q3: Member function definitions:

 
End of Question 3


Question 4.
9.2 Q4: Parameterized stream manipulator setfill specifies the fill character that is displayed when an output is displayed in a field wider than the number of characters or digits in the output. The effect of setfill applies:

 
End of Question 4


Question 5.
9.2 Q5: Every object of the same class:

 
End of Question 5


Question 6.
9.2 Q6: Classes cannot:

 
End of Question 6


Question 7.
Section 9.3 Class Scope and Accessing Class Members

9.3 Q1: Variables defined inside a member function of a class have:

 
End of Question 7


Question 8.
9.3 Q2: A class-scope variable hidden by a block-scope variable can be accessed by preceding the variable name with the class name followed by:

 
End of Question 8


Question 9.
Section 9.4 Separating Implementation from Interface
,br> 9.4 Q1: When independent software vendors provide class libraries to clients, they typically give the __________ for the class’s interface and the __________ for the class’s implementation.

 
End of Question 9


Question 10.
9.4 Q2: Which of the following is not true about separating a class’s interface and implementation?

 
End of Question 10


Question 11.
Section 9.5 Access Functions and Utility Functions

9.5 Q1: The type of function a client would use to check the balance of his bank account would be:

 
End of Question 11


Question 12.
9.5 Q2: Utility functions:

 
End of Question 12


Question 13.
Section 9.6 Time Class Case Study: Constructors with Default Arguments

9.6 Q1: A default constructor:

 
End of Question 13


Question 14.
9.6 Q2: If a member function of a class already provides all or part of the functionality required by a constructor or another member function then:

 
End of Question 14


Question 15.
Section 9.7 Destructors

9.7 Q1: Which of the following is not true of a constructor and destructor of the same class?

 
End of Question 15


Question 16.
9.7 Q2: Which of the following is not true of a destructor?

 
End of Question 16


Question 17.

Section 9.8 When Constructors and Destructors Are Called

9.8 Q1: Given the class definition:

class CreateDestroy
{
public:	
   CreateDestroy() { cout << "constructor called, "; }
   ~CreateDestroy() { cout << "destructor called, "; } 
};

What will the following program output?

int main()
{
   CreateDestroy c1;
   CreateDestroy c2;
   return 0;
}
 
End of Question 17


Question 18.

9.8 Q2: Given the class definition:

class CreateDestroy
{
public:
   CreateDestroy() { cout << "constructor called, "; }
   ~CreateDestroy() { cout << "destructor called, "; } 
};


What will the following program output?

int main()
{
   for ( int i = 1; i <= 2; i++ )
      CreateDestroy cd;
   return 0;
}
 
End of Question 18


Question 19.
Section 9.9 Time Class Case Study: A Subtle Trap—Returning a Reference to a private Data Member

9.9 Q1: Returning references to non-const, private data:

 
End of Question 19


Question 20.
9.9 Q2: A client changing the values of private data members is:

 
End of Question 20


Question 21.
Section 9.10 Default Memberwise Assignment

9.10 Q1: The assignment operator (=) can be used to:

 
End of Question 21


Question 22.
Section 9.11 Software Reusability

9.11 Q1: Many ___________ exist which help to develop programs from portable, carefully tested and widely available components.

 
End of Question 22


Question 23.
Section 9.12 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System

9.12 Q1: Associations in a class diagram that have no navigability arrows at all indicate:

 
End of Question 23


Question 24.
9.12 Q2: Which of the following is not true about declaring references to objects of other classes inside a class definition?

 
End of Question 24





Pearson Copyright © 1995 - 2010 Pearson Education . All rights reserved.
Legal Notice | Privacy Policy | Permissions

Return to the Top of this Page