Chapter 1 Exercise Solutions
EX 1.1. Describe the hardware components of your personal computer or of a computer in a
lab to which you have access. Include the processor type and speed, storage
capacities of main and secondary memory, and types of I/O devices. Explain how you
determined your answers.
One possible description: Processor: Intel Celeron D, 2.53 GHz Main Memory: 2 GB SDRAM
EX 1.2. Why are magnetic devices considered as effective means of representing the binary
values?
EX 1.3. How many bits are required to uniquely represent each of the following?
EX 1.4. Assuming there are 366 days in a year, how many bits would be needed to store each day
of the year? Why?
EX 1.5. If all rainbow colors are to be represented by a unique bit pattern, how many bits
would be needed to store each color? Why?
EX 1.6. What is the usage of each of the following elements in a Graphical User Interface (GUI)?
EX 1.7. Explain the difference between CD-Recordable disc (CD-R) and CD-Rewritable disc
(CD-RW).
EX 1.8. A DVD is a secondary memory device like CD but it can store more information. Why?
EX 1.9. Determine how your computer, or a computer in a lab to which you have access, is
connected to others across a network. Is it linked to the Internet? Draw a diagram to
show the basic connections in your environment.
EX 1.10. What is the significance of a Domain Name System (DNS) in the Internet? What
would happen without a DNS?
EX 1.11. What is the total number of communication lines needed for a fully connected point
to-point network of eight computers? Nine computers? Ten computers? What is a
general formula for determining this result?
EX 1.12. Explain the difference between a web browser and a web server.
EX 1.13. List and explain the parts of the URLs for:
a. your school
http://www.byu.edu, where http stands for HyperText Transfer Protocol, which determines the
b. the Computer Science department of your school
c. your instructor’s Web page
EX 1.14. Give examples of the three categories of Java identifiers and explain the differences
between them.
EX 1.15. Which of the following are valid Java identifiers?
a. Remainder
b. 9_multiple
c. addTwoIntegers
d. PI_VALUE
e. highestof3
f. sum&product
g. diff_&_div
EX 1.16. Which of the following valid Java identifier clearly represents the “current item being
processed”?
c. currentItem
EX 1.17. What is a method in Java programming language?
EX 1.18. Differentiate between Java bytecode and machine language code.
EX 1.19. What do we mean when we say that the English language is ambiguous? Givetwo
examples of English ambiguity (other than the example used in this chapter) and
explain the ambiguity. Why is ambiguity a problem for programming languages?
EX 1.20. Identify which of the following lead to: a compile-time error, run-time error, or logical
error.
a. writing print1n when you should have written println
b. forgetting a } at the end of a method body
c. calculating sum of numbers instead of product of numbers
logical error
d. typing a , instead of a . in System.out.println
e. forgetting to put an end of line character.
f. subtracting a variable by itself in the denominator