Appendix B: Answers to Quizzes and Final Exam


Chapter 1

  1. An object is a person, place, thing, concept, or possibly event.

  2. An attribute is a characteristic of an object.

  3. A behavior is an action that an object is capable of performing.

  4. Focusing on objects makes it easy for us to understand complex things. Objects enable us to look at details that are of interest to us and ignore other details that we are not interested in.

  5. Inheritance is a way for one object to receive attributes and behaviors of another object in what programmers call an is a relationship.

  6. Attributes and behaviors need to be defined in one object, such as Person. Other objects that require those attributes and behaviors ”such as Student, Teacher, Department Chair, Dean, Secretary, and Bursar ”can inherit the object. This allows for attributes and behaviors to be defined in only one object, making it easy to add new attributes and behaviors or remove existing attributes and behaviors.

  7. The attributes of the order form in Figure 1-1 are as follows :

    • Customer Name

    • Customer Address

    • Customer Number

    • P.O. Number

    • Date Shipped

    • Shipped Via

    • Required Date

    • Terms

    • Quantity

    • Item ID

    • Item Name

    • Unit Price

    • Amount

    • Subtotal

    • Sales Tax

    • Shipping & Handling

    • Total Due

  8. The behaviors of the order form in Figure 1-1 are as follows:

    • Enter order information

    • Modify order information

    • Delete order

    • Process order

    • Look up order

  9. These are common objects that inherit a Person object:

    • Student

    • Instructor

    • Dean

    • President

    • Board of Trustees

    • Security Manager

    • Security Guard

    • Bookstore Manager

    • Sales Assistant

    • Department Chair

    • Bursar

    • Registrar

    • Maintenance Manager

    • Maintenance Worker

    • Secretary

  10. See Figure B-1.

    click to expand
    Figure B-1: The relationship between the Person object and objects that are persons




OOP Demystified
OOP Demystified
ISBN: 0072253630
EAN: 2147483647
Year: 2006
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net