Quiz


1.  

What is an object?

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

2.  

What is an attribute of an object?

an attribute is a characteristic of an object.

3.  

What is a behavior of an object?

a behavior is an action that an object is capable of performing.

4.  

Why it is important for programmers to use object-oriented programming to develop computer systems?

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.  

Explain the role of inheritance in object-oriented programming.

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

6.  

How can object-oriented programming help maintain complex computer systems?

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.  

Identify the attributes of the order form in Figure 1-1.

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.  

Identify the behaviors of the order form in Figure 1-1.

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.  

Describe objects in a college that might inherit a Person object.

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.  

Draw a diagram that shows the relationships of objects that you listed in your answer to Question 9.

see figure b-1 .

Answers

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.




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

Similar book on Amazon

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