Cs132 Quiz #4 - Classes

19 Questions | Total Attempts: 337

SettingsSettingsSettings
Cs132 Quiz #4 - Classes - Quiz

CS132 Quiz #4 - Classes


Questions and Answers
  • 1. 
    A ________ is a user defined data type.
    • A. 

      Abstract data type

    • B. 

      Object

    • C. 

      Variable

    • D. 

      Pointer

  • 2. 
    Each data type consists of both a type and ________ for the type.
    • A. 

      Attributes

    • B. 

      Operational capabilities

    • C. 

      Structures

    • D. 

      Prototypes

  • 3. 
    A ________ is defined as the combination of data and the operations that can be performed on the data.
    • A. 

      Specification

    • B. 

      Address

    • C. 

      Data type

    • D. 

      Pointer

  • 4. 
    A ________ is an abstract data type that defines both data and functions.
    • A. 

      Class

    • B. 

      Object

    • C. 

      Prototype

    • D. 

      Structure

  • 5. 
    A ________ is a function contained in a class.
    • A. 

      Attribute

    • B. 

      Class member

    • C. 

      Data member

    • D. 

      Method

  • 6. 
    Object oriented programming: (I) supports code reusability, (II) is an exclusive feature of C++, and (III) contribute to productivity in software development.
    • A. 

      Only I and II are correct.

    • B. 

      Only I and III are correct.

    • C. 

      Only II and III are correct.

    • D. 

      All of them are correct.

  • 7. 
    A class member is a data member. This statement is:
    • A. 

      Always true.

    • B. 

      Sometimes true.

    • C. 

      Never true.

    • D. 

      Worthless (just like my instructor in CS132).

  • 8. 
    A data member is a member function. This statement is:
    • A. 

      Always true.

    • B. 

      Sometimes true.

    • C. 

      Never true.

    • D. 

      Funny (just like the face of my instructor in CS132).

  • 9. 
    Data members are also called ________.
    • A. 

      Methods

    • B. 

      Function prototypes

    • C. 

      Instance variables

    • D. 

      Instance methods

  • 10. 
    Class names ________ start with a capital letter.
    • A. 

      May

    • B. 

      Should never

    • C. 

      Should always

    • D. 

      Will cause an error when they

  • 11. 
    ________ define the access rights to variables and functions in a class.
    • A. 

      Class members

    • B. 

      Function parameters

    • C. 

      Overloaders

    • D. 

      Access specifiers

  • 12. 
    The private members of a class can be accessed by any function all throughout that particular class.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes true

    • D. 

      Cannot determine from the given statement

  • 13. 
    The public members of a class can be accessed by any function all throughout that particular class.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes false

    • D. 

      Cannot determine from the given statement

  • 14. 
    A ________ is a function used to initialize class members with values.
    • A. 

      Destructor

    • B. 

      Function prototype

    • C. 

      Method

    • D. 

      Constructor

  • 15. 
    If for example, there is a class named Person. Then, an appropriate constructor header of that class would be:
    • A. 

      Person::Person( )

    • B. 

      Void Person::Person( )

    • C. 

      Person::setPerson( )

    • D. 

      Void Person::setPerson( )

  • 16. 
    A class may have more than one constructor.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes true

    • D. 

      Cannot determine from the given statement

  • 17. 
    A class may have more than one default constructor.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes false

    • D. 

      Cannot determine from the given statement

  • 18. 
    You can create one or more objects from a class.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes true

    • D. 

      Cannot determine from the given statement

  • 19. 
    You can create one or more classes out of a single object.
    • A. 

      True

    • B. 

      False

    • C. 

      Sometimes true

    • D. 

      Cannot determine from the given statement

Back to Top Back to top