Page 57 - Introduction to Programming with Java: A Problem Solving Approach
P. 57
§1.7 Emergence of Java
11. List five different types of Java programs.
Exercises
1. [after §1.2] For each of the following items, determine whether it is associated with main memory or auxiliary memory.
a) floppy disk main or auxiliary? b)RAM mainorauxiliary? c) hard disk main or auxiliary? d) CD-RW main or auxiliary?
2. [after §1.2] What is a bit?
3. [after §1.2] What is a byte?
4. [after §1.2] What type of computer component does C: usually refer to?
5. [after §1.2] For each of the following computer system components, identify parallel components in a bear’s
biological system. a) CPU
b) input devices c) output devices
7. [after §1.3] This question is not very specific, so don’t worry about whether your solution conforms to some prescribed answer. Just do whatever seems reasonable to you.
Using pseudocode in the form of short statements, provide an algorithm for a bear that describes the steps involved in gathering honey. If a certain step or a group of steps is to be repeated, use an if statement and an arrow to show the repetition. For example, your algorithm might include something like this:
<statement>
<statement>
<statement>
.
Exercises 23
6. [after §1.2] What is “Moore’s Law”? You won’t find the answer to the question in the book, but you can find it on the Internet. (Hint: Gordon Moore was one of the founders of Intel.)
Apago PDF Enhancer
.
<statement>
If still hungry, repeat
8. [after §1.5] Humans generally prefer to work with source code rather than object code because source code is easier to understand than object code. So why is object code necessary?
9. [after§1.6]Mostprogramminglanguagescompiledowntoobjectcode.Javacompilesdowntobytecode. What is the primary benefit of bytecode over object code?
10. [after §1.6] What does the Java Virtual Machine do?
11. [after §1.7] What was the original name for the Java programming language?
12. [after §1.8] On a computer whose operating system is a recent version of Microsoft Windows, invoke Start >
Programs > Accessories > Command Prompt. Navigate to the directory that has the Hello.java sourcecode.Enterdir Hello.*tolistallfilesstartingwith“Hello”.IfthislistincludesHello.class, delete that file by entering del Hello.class. Enter javac Hello.java to compile the source code. Againenterdir Hello.*andverifythatthebytecodefile,Hello.class,hasbeencreated.Nowyou can enter java Hello to execute the compiled program. Enter type Hello.java and type Hello.class to get a feeling for how bytecode differs from source code.