Chapter 1
1.3 a. 21 = 2
b.
23 = 8
c.
26 = 64
d.
28 = 256
e.
210 = 1024
f.
216 = 65536
1.5 8 because 28 = 256 the smallest power of 2 greater than 240
1.6 1 kilobyte = 1024 bytes = 1024 * 8 = 8192 bits.
So
a.
12 KB = 12 * 8192 = 98304 bits
1 megabyte = 1024*1024
= 1048576 bytes = 8388608 bits
b.
5 MG = 5*8388608 = 41943040 bits
1 gigabyte = 1073741824
bytes = 8589934592 bits
c.
3 GB = 25769803776 bits
1 terabyte = 109951162776
bytes = 8796093022208 bits
d. 2 TB
= 17592186044416 bits
1.16. The invalid identifiers are 2ndLevel (starts
with a number) and hook&ladder (& is not a Java letter or digit)
The rest are valid although anExtremelyLongIdentifierIfYouAskMe is unnecessarily
long
1.17 q does not give sufficient information
totVal
can be confusing
theNextValueInTheList
is long and unnecessary. nextValue gives the same information
1.22 The total number of pixels is 400*250 = 100000
pixels
Each pixel
requires 1 Byte or 8 bits. So the total number of bits is 800000.