1
Introduction to Computers,
the Internet and Java
Objectives
In this chapter you’ll:
Learn about exciting recent
developments in the computer
field.
Learn computer hardware,
software and networking
basics.
Understand the data hierarchy.
Understand the different types
of programming languages.
2Chapter 1 Introduction to Computers, the Internet and Java
Self-Review Exercises
1.1 Fill in the blanks in each of the following statements:
a) Computers process data under the control of sets of instructions called .
b) The key logical units of the computer are the , , ,
, and .
c) The three types of languages discussed in the chapter are , and
.
d) The programs that translate high-level language programs into machine language are
called .
e) is an operating system for mobile devices based on the Linux kernel and Java.
f) software is generally feature complete, (supposedly) bug free and ready for
use by the community.
g) The Wii Remote, as well as many smartphones, use a(n) which allows the de-
vice to respond to motion.
1.2 Fill in the blanks in each of the following sentences about the Java environment:
a) The command from the JDK executes a Java application.
b) The command from the JDK compiles a Java program.
c) A Java source code file must end with the file extension.
d) When a Java program is compiled, the file produced by the compiler ends with the
file extension.
e) The file produced by the Java compiler contains that are executed by the Java
1.3 Fill in the blanks in each of the following statements (based on Section 1.5):
a) Objects enable the design practice of —although they may know how to com-
municate with one another across well-defined interfaces, they normally are not allowed
to know how other objects are implemented.
b) Java programmers concentrate on creating , which contain fields and the set
of methods that manipulate those fields and provide services to clients.
c) The process of analyzing and designing a system from an object-oriented point of view
Exercises 3
d) A new class of objects can be created conveniently by —the new class (called
the subclass) starts with the characteristics of an existing class (called the superclass),
possibly customizing them and adding unique characteristics of its own.
e) is a graphical language that allows people who design software systems to use
an industry-standard notation to represent them.
f) The size, shape, color and weight of an object are considered of the object’s
class.
Exercises
1.4 Fill in the blanks in each of the following statements:
a) The logical unit that receives information from outside the computer for use by the
computer is the .
b) The process of instructing the computer to solve a problem is called .
c) is a type of computer language that uses Englishlike abbreviations for ma-
chine-language instructions.
d) is a logical unit that sends information which has already been processed by
the computer to various devices so that it may be used outside the computer.
e) and are logical units of the computer that retain information.
f) is a logical unit of the computer that performs calculations.
g) is a logical unit of the computer that makes logical decisions.
h) languages are most convenient to the programmer for writing programs
quickly and easily.
i) The only language a computer can directly understand is that computer’s .
j) is a logical unit of the computer that coordinates the activities of all the other
logical units.
1.5 Fill in the blanks in each of the following statements:
a) The programming language is now used to develop large-scale enterprise ap-
plications, to enhance the functionality of web servers, to provide applications for con-
sumer devices and for many other purposes.
b) initially became widely known as the development language of the UNIX op
erating system.
4Chapter 1 Introduction to Computers, the Internet and Java
c) The ensures that messages, consisting of sequentially numbered pieces called
bytes, were properly routed from sender to receiver, arrived intact and were assembled
in the correct order.
d) The programming language was developed by Bjarne Stroustrup in the early
1980s at Bell Laboratories.
1.6 Fill in the blanks in each of the following statements:
a) Java programs normally go through five phases— , , ,
and .
b) A(n) provides many tools that support the software development process,
such as editors for writing and editing programs, debuggers for locating logic errors in
programs, and many other features.
c) The command java invokes the , which executes Java programs.
d) A(n) is a software application that simulates a computer, but hides the under-
lying operating system and hardware from the programs that interact with it.
e) The takes the .class files containing the program’s bytecodes and transfers
them to primary memory.
f) The examines bytecodes to ensure that they’re valid.
1.7 Explain the two compilation phases of Java programs.
1.8 One of the world’s most common objects is a wrist watch. Discuss how each of the follow-
ing terms and concepts applies to the notion of a watch: object, attributes, behaviors, class, inheri-
tance (consider, for example, an alarm clock), modeling, messages, encapsulation, interface and
information hiding.
Making a Difference 5
Making a Difference
The Making-a-Difference exercises will ask you to work on problems that really matter to individ-
uals, communities, countries and the world.
1.9 (Test Drive: Carbon Footprint Calculator) Some scientists believe that carbon emissions,
especially from the burning of fossil fuels, contribute significantly to global warming and that this
1.10 (Test Drive: Body-Mass-Index Calculator) By recent estimates, two-thirds of the people in
the United States are overweight and about half of those are obese. This causes significant increases
1.11 (Attributes of Hybrid Vehicles) In this chapter you learned the basics of classes. Now you’ll
begin “fleshing out” aspects of a class called “Hybrid Vehicle.” Hybrid vehicles are becoming increas-
ingly popular, because they often get much better mileage than purely gasoline-powered vehicles.
Browse the web and study the features of four or five of today’s popular hybrid cars, then list as many
of their hybrid-related attributes as you can. For example, common attributes include city-miles-per-
gallon and highway-miles-per-gallon. Also list the attributes of the batteries (type, weight, etc.).
1.12 (Gender Neutrality) Some people want to eliminate sexism in all forms of communication.
You’ve been asked to create a program that can process a paragraph of text and replace gender-spe-
cific words with gender-neutral ones. Assuming that you’ve been given a list of gender-specific
words and their gender-neutral replacements (e.g., replace “wife” with “spouse,” “man” with “per-
son,” “daughter” with “child” and so on), explain the procedure you’d use to read through a para-
graph of text and manually perform these replacements. How might your procedure generate a
strange term like “woperchild?” In Chapter 4, you’ll learn that a more formal term for “procedure”
is “algorithm,” and that an algorithm specifies the steps to be performed and the order in which to
perform them.
1.13 (Intelligent Assistants) Developments in the field of artificial intelligence have been acceler-
1.14 (Big Data) Research the rapidly growing field of big data. List applications that hold great
1.15 (Internet of Things) It’s now possible to have a microprocessor at the heart of just about any