1 |
h05 |
CS32 S17 |
Name: | ||||
---|---|---|---|---|
(as it would appear on official course roster) | ||||
Umail address: | @umail.ucsb.edu | section |
||
Optional: name you wish to be called if different from name above. | ||||
Optional: name of "homework buddy" (leaving this blank signifies "I worked alone" |
h05: Inheritance
ready? | assigned | due | points |
---|---|---|---|
true | Thu 05/11 09:30AM | Tue 05/16 09:30AM |
You may collaborate on this homework with AT MOST one person, an optional "homework buddy".
MAY ONLY BE TURNED IN IN THE LECTURE/LAB LISTED ABOVE AS THE DUE DATE,
OR IF APPLICABLE, SUBMITTED ON GRADESCOPE. There is NO MAKEUP for missed assignments;
in place of that, we drop the three lowest scores (if you have zeros, those are the three lowest scores.)
Reading: Inheritance, PS 15, PS 14.1
- (10 pts) Fill in the information in the header. The following are required to get the 10 "participation" points.
- Filling in your name and umail address.
- WRITING (not circling!) either 11, 12, 1, or 2, to indicate your discussion section (lab) meeeting time.
Also: For paper submission PLEASE submit on ONE SHEET OF PAPER, double-sided if at all possible. If you must submit on two printed sheets write name on BOTH sheets and no staples, paperclips, or folded corners.
For gradescope self-submission: PLEASE get the pages in the correct order. First page of your PDF file is p1, the next is p2. - Filling in your name and umail address.
- (5 pts) What is the difference between calling a function and calling a method?
- (5 pts) What two features distinguish Object-Oriented Programming from Object-Based Programming?
- (6 pts) List the three kinds of polymorphism.
- (4 pts) State the Liksov Substitution Principle.
- Class D derives from (is a subclass of) class C.
- (2 pts) Should D's preconditions be more or less strong than C's?
- (2 pts) Should D's postconditions be more or less strong than C's?
- (8 pts) List two ways in which a derived class can differ from its base class.
- (4 pts) If your derived class does not implement any constructors, what does the automatically-created constructor do?
- (4 pts) Name four methods that are automatically created if you do not implement them yourself.