User Defined Types  «Prev  Next»

Classes are user-defined Data Types

Each question is worth one point. Select the best answer or answers for each question.
 

1. Consider a Teacher class. Which of the following statements about this class is most true?
Please select the best answer.
  A. John Smith is an attribute of the Teacher class.
  B. The Teacher class is an attribute of John Smith.
  C. High School Teacher is an instance of the Teacher class.
  D. John Smith is an instance of the Teacher class.

2. What is the largest group of data types that you can choose from to specify the attributes of a class?
Please select the best answer.
  A. Numbers or strings only
  B. Numbers, strings, and built-in data types of a language only
  C. Positive numbers, strings, and built-in data types of a language only
  D. Numbers, strings, built-in data types of a language, and user-defined objects in other classes

3. Consider a ReportCard class. Which one of these design requirements would be best handled through class composition?
Please select the best answer.
  A. The report card will be two pages long.
  B. The report card will show the student's name.
  C. The report card will show the teacher's name.
  D. The report card will show contact information for the school.

4. Which of the statements below illustrates a proper use of an object diagram?
Please select the best answer.
  A. An object diagram helps everyone understands the types of the attributes of a class.
  B. An object diagram provides an example of values for all the attributes of a class.
  C. An object diagram demonstrates the business rules of each class.
  D. An object diagram lists the names of all the objects in the system.
Correct answers:

Your Score: 0