Programming and Problem Solving with Java

(やまだぃちぅ) #1
35

check your response against the answers listed at the end of the Quick Check. If you
don’t know an answer or don’t understand the answer that’s provided, turn to the
page(s) listed at the end of the question to review the material.


1.What is a computer program? (p. 5)
2.What are the three phases in a program’s life cycle? (pp. 5–9)
3.Is an algorithm the same as a program? (p. 6)
4.What are the advantages of using a high-level programming language?
(pp. 10–11)
5.What is the difference between machine code and Bytecode? (pp. 12–13)
6.What part does the Java Virtual Machine play in the compilation and interpreta-
tion process? (pp. 14–15)
7.What are the six basic components of a computer? (pp. 20–22)
8.What is meant by the term object, in the context of programming? (pp. 5, 18–20)
9.What should you do before you begin to code a problem solution in Java?
(pp. 22–24, 28–29)
10.Name the five basic ways of structuring statements in Java. (pp. 15–18)
11.What is the difference between hardware and software? (p. 22)
12.Name the problem-solving technique in which we break the problem into more
manageable chunks. (pp. 24–28)
13.Which problem-solving technique would be a natural choice in planning a hike
between two campgrounds? (pp. 24–28)
14.In the following problem statement, what are the objects: “Compute the area of
a circle, given its radius.” (pp. 5, 18–20, 29)

Answers



  1. A computer program is a list of instructions performed by a computer. 2. The three phases of a program’s life
    cycle are problem solving, implementation, and maintenance. 3. No. A program is an algorithm written in a
    programming language. All programs are algorithms, but not all algorithms are programs. 4. A high-level pro-
    gramming language is easier to use than an assembly language or a machine language. Also, programs written
    in a high-level language can be run on many different computers. 5. Machine code is the native binary
    language that is directly executed by any particular computer. Bytecode is a standard portable machine
    language that is executed by the Java Virtual Machine, but it is not directly executed by the computer. 6. It
    translates the Bytecode instructions into operations that are executed by the computer. 7. The basic
    components of a computer are the memory unit, arithmetic/logic unit, control unit, input devices, output de-
    vices, and auxiliary storage devices. 8. A collection of data and associated operations that can be applied to the
    data. 9. Understand the problem and develop an algorithmic solution to the problem. 10. Sequence, selection,
    loop, subprogram, and asynchronous. 11. Hardware is the physical components of the computer; software is
    the collection of programs that run on the computer. 12. Divide and conquer. 13. Means-ends analysis. 14. Area,
    circle, and radius are the obvious objects.

Free download pdf