
lafore_robert_objectoriented_programming_in_c
.pdf

Chapter 16
846
17.True or false: Attribution is one of the major class relationships.
18.Assume there is an association between class A and class B. Also, objA is an object of class A, and objB is an object of class B. Which of the following applies?
a.objA may send a message to objB.
b.Class B must be a subclass of class A, or vice versa.
c.objB must be an attribute of class A, or vice versa.
d.objB may help objA carry out a task.
19.The LANDLORD program makes use of
a.generalization.
b.association.
c.insubordination.
d.aggregation.
20.True or false: In a class diagram, an association is shown as a relationship between objects.
21.In a sequence diagram
a.time goes from left to right.
b.associations go from right to left.
c.horizontal arrows represent messages.
d.vertical dotted lines represent lifetime.
22.A sequence diagram shows messages from one ________ to another.
23.True or false: A sequence diagram often describes a single use case.
24.In a sequence diagram, when a new class instance is created
a.a rectangle with its name is drawn at the appropriate vertical coordinate.
b.a large X marks the point in time.
c.its activity box begins.
d.its lifeline begins.
Projects
We don’t have room in this book for exercises involving the kind of projects involved in this chapter. However, we list some suggestions for projects you may want to pursue on your own.
1.Reread the explanation of the HORSE program from Chapter 10, “Pointers,” but do not look at the code. Create a use case diagram and a class diagram for this program. Use the results to create a .H file, and compare your results with the program. There are many correct results.




850 |
Appendix A |
|
TABLE A.1 IBM Character Codes
DEC |
HEX |
Symbol |
Key |
Use in C |
0 |
00 |
(NULL) |
Ctrl 2 |
|
1 |
01 |
A |
Ctr A |
|
2 |
02 |
B |
Ctrl B |
|
3 |
03 |
C |
Ctrl C |
|
4 |
04 |
D |
Ctrl D |
|
5 |
05 |
E |
Ctrl E |
|
6 |
06 |
F |
Ctrl F |
|
7 |
07 |
G |
Ctrl G |
Beep |
8 |
08 |
H |
Backspace |
Backspace |
9 |
09 |
I |
Tab |
Tab |
10 |
0A |
J |
Ctrl J |
Linefeed (new line) |
11 |
0B |
K |
Ctrl K |
Vertical Tab |
12 |
0C |
L |
Ctrl L |
Form Feed |
13 |
0D |
M |
Enter |
Carriage Return |
14 |
0E |
N |
Ctrl N |
|
15 |
0F |
O |
Ctrl O |
|
16 |
10 |
P |
Ctrl P |
|
17 |
11 |
Q |
Ctrl Q |
|
18 |
12 |
R |
Ctrl R |
|
19 |
13 |
S |
Ctrl S |
|
20 |
14 |
T |
Ctrl T |
|
21 |
15 |
U |
Ctrl U |
|
22 |
16 |
_ |
Ctrl V |
|
23 |
17 |
W |
Ctrl W |
|
24 |
18 |
X |
Ctrl X |
|
25 |
19 |
Y |
Ctrl Y |
|
26 |
1A |
Z |
Ctrl Z |
|
27 |
1B |
a |
Esc |
|
28 |
1C |
b |
Ctrl \ |
|
29 |
1D |
c |
Ctrl ] |
|
30 |
1E |
d |
Ctrl 6 |
|
31 |
1F |
e |
Ctrl - |
|


852 |
Appendix A |
|
TABLE A.1 Continued
DEC |
HEX |
Symbol |
Key |
Use in C |
64 |
40 |
@ |
@ |
|
65 |
41 |
A |
A |
|
66 |
42 |
B |
B |
|
67 |
43 |
C |
C |
|
68 |
44 |
D |
D |
|
69 |
45 |
E |
E |
|
70 |
46 |
F |
F |
|
71 |
47 |
G |
G |
|
72 |
48 |
H |
H |
|
73 |
49 |
I |
I |
|
74 |
4A |
J |
J |
|
75 |
4B |
K |
K |
|
76 |
4C |
L |
L |
|
77 |
4D |
M |
M |
|
78 |
4E |
N |
N |
|
79 |
4F |
O |
O |
|
80 |
50 |
P |
P |
|
81 |
51 |
Q |
Q |
|
82 |
52 |
R |
R |
|
83 |
53 |
S |
S |
|
84 |
54 |
T |
T |
|
85 |
55 |
U |
U |
|
86 |
56 |
V |
V |
|
87 |
57 |
W |
W |
|
88 |
58 |
X |
X |
|
89 |
59 |
Y |
Y |
|
90 |
5A |
Z |
Z |
|
91 |
5B |
[ |
[ |
|
92 |
5C |
\ |
\ |
|
93 |
5D |
] |
] |
|
94 |
5E |
^ |
^ |
|
95 |
5F |
_ |
_ |
|


854 |
Appendix A |
|
TABLE A.1 Continued
DEC |
HEX |
Symbol |
Key |
Use in C |
128 |
80 |
Ä |
Alt 128 |
|
129 |
81 |
ü |
Alt 129 |
|
130 |
82 |
é |
Alt 130 |
|
131 |
83 |
É |
Alt 131 |
|
132 |
84 |
ä |
Alt 132 |
|
133 |
85 |
à |
Alt 133 |
|
134 |
86 |
å |
Alt 134 |
|
135 |
87 |
ç |
Alt 135 |
|
136 |
88 |
ê |
Alt 136 |
|
137 |
89 |
ë |
Alt 137 |
|
138 |
8A |
è |
Alt 138 |
|
139 |
8B |
ï |
Alt 139 |
|
140 |
8C |
î |
Alt 140 |
|
141 |
8D |
ì |
Alt 141 |
|
142 |
8E |
Ä |
Alt 142 |
|
143 |
8F |
Å |
Alt 143 |
|
144 |
90 |
É |
Alt 144 |
|
145 |
91 |
æ |
Alt 145 |
|
146 |
92 |
Æ |
Alt 146 |
|
147 |
93 |
ô |
Alt 147 |
|
148 |
94 |
ö |
Alt 148 |
|
149 |
95 |
ò |
Alt 149 |
|
150 |
96 |
û |
Alt 150 |
|
151 |
97 |
ù |
Alt 151 |
|
152 |
98 |
ÿ |
Alt 152 |
|
153 |
99 |
Ö |
Alt 153 |
|
154 |
9A |
Ü |
Alt 154 |
|
155 |
9B |
õ |
Alt 155 |
|
156 |
9C |
£ |
Alt 156 |
|
157 |
9D |
¥ |
Alt 157 |
|
158 |
9E |
û |
Alt 158 |
|
159 |
9F |
ü |
Alt 159 |
|