1 |
h01 |
CS24 M19 |
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" |
h01: Chapter 1.1, 2.1-2.2
ready? | assigned | due | points |
---|---|---|---|
true | Tue 08/06 02:00PM | Fri 08/16 02:00PM | 100 |
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 lowest scores (if you have zeros, those are the lowest scores.)
Reading: Read Chapter 1.1, 2.1-2.2. If you don’t have a copy of the textbook yet, there is one on reserve at the library under “COMP000-STAFF - Permanent Reserve”. Homeworks should be turned in during your registered lab hour.
-
1. (5 pts) Name two benefits of procedural abstraction in writing code.
2. (5 pts) Describe a technique for incorporating the principle of information hiding when describing a function's behaviour.
3. (10 pts) Write the pre and post conditions for a function that takes as input two parameters: distance (in meters) and time (in seconds), and computes speed as output.
4. (5 pts) Which access specifier should be used to hide member functions and variables from code outside of the class?
5. (5 pts) What is the difference between a class and an object?
2 |
h01 |
CS24 M19 |