Test Bank for Java Software Solutions 7th
Edition (International Edition). John Lewis /
William Loftus download
https://testbankmall.com/product/test-bank-for-java-software-
solutions-7th-edition-international-edition-john-lewis-william-
loftus/
Find test banks or solution manuals at testbankmall.com today!
Here are some recommended products for you. Click the link to
download, or explore more at testbankmall.com
Test Bank for Java Software Solutions, 9th Edition John
Lewis William Loftus
https://testbankmall.com/product/test-bank-for-java-software-
solutions-9th-edition-john-lewis-william-loftus/
Test Bank for Java Software Solutions: Foundations of
Program Design, 7/E 7th Edition John Lewis, William Loftus
https://testbankmall.com/product/test-bank-for-java-software-
solutions-foundations-of-program-design-7-e-7th-edition-john-lewis-
william-loftus/
Solution manual for Java Software Solutions for AP
Computer Science A, 2/E 2nd Edition John Lewis, William
Loftus, Cara Cocking
https://testbankmall.com/product/solution-manual-for-java-software-
solutions-for-ap-computer-science-a-2-e-2nd-edition-john-lewis-
william-loftus-cara-cocking/
Experiments in Physiology 11th Edition Woodman Solutions
Manual
https://testbankmall.com/product/experiments-in-physiology-11th-
edition-woodman-solutions-manual/
Elementary Statistics A Step By Step Approach Bluman 8th
Edition Solutions Manual
https://testbankmall.com/product/elementary-statistics-a-step-by-step-
approach-bluman-8th-edition-solutions-manual/
Test Bank for The World of Psychology, Eighth Canadian
Edition
https://testbankmall.com/product/test-bank-for-the-world-of-
psychology-eighth-canadian-edition/
Test Bank For Business Law: Text and Cases 14th Edition
https://testbankmall.com/product/test-bank-for-business-law-text-and-
cases-14th-edition/
Maternal-Child Nursing Care, 1st Edition Test Bank
https://testbankmall.com/product/maternal-child-nursing-care-1st-
edition-test-bank/
Test Bank for The Economics of Money, Banking and
Financial Markets 12th Edition Mishkin
https://testbankmall.com/product/test-bank-for-the-economics-of-money-
banking-and-financial-markets-12th-edition-mishkin/
Solution Manual for Business, 12th Edition
https://testbankmall.com/product/solution-manual-for-business-12th-
edition/
2
Copyright © 2012 Pearson Education, Inc.
4) Which memory capacity is the largest?
A) 1,500,000,000,000 bytes
B) 100 gigabytes
C) 3,500,000 kilobytes
D) 10 terabyte
E) 12,000,000 megabytes
Answer: E
Explanation: E) We convert each of these capacities to bytes (rounding off) to compare them.
The value in A remains the same, 1 1/2 trillion bytes. The value in B is 100 billion bytes. The
value in C is 3 1/2 billion bytes. The value in D is 10 trillion bytes. The answer in E is 12
trillion bytes.
5) Binary numbers are composed entirely of
A) 0s
B) 1s
C) 0s and 1s
D) 0s, 1s and 2s
E) any digits between 0 and 9
Answer: C
Explanation: C) Binary is base 2. In Mathematics, numbers in base n are composed entirely of
digits between 0 and n-1.
6) Volatility is a property of
A) RAM
B) ROM
C) disk
D) software
E) computer networks
Answer: A
Explanation: A) Volatility means that the contents of memory are lost if the electrical power is
shut off. This is true of RAM (Random Access Memory), but not ROM (Read Only Memory) or
disk. Software and computer networks are not forms of memory.
7) The ability to directly obtain a stored item by referencing its address is known as
A) random access
B) sequential access
C) read-only access
D) fetch access
E) volatility
Answer: A
Explanation: A) Random access is meant to convey the idea that accessing any item is equally
easy, and that any item is retrievable based solely on its address. Random access is the form of
access used by both RAM and ROM memory. Disk access, called direct access, is a similar idea,
and direct and random access are sometimes referred to synonymously. Sequential access is
used by tape.
3
Copyright © 2012 Pearson Education, Inc.
8) Which phase of the fetch-decode-execute cycle might use a circuit in the arithmetic-logic
unit?
A) fetch
B) decode
C) execute
D) during fetch or execute, but not decode
E) could be used in fetch, decode or execute phase
Answer: C
Explanation: C) The fetch phase retrieves (fetches) the next program instruction from memory.
The decode phase determines which circuit(s) needs to be used to execute the instruction. The
instruction is executed during the execute phase. If the instruction is either an arithmetic
operation (like add or multiply) or a logical operation (like comparing two values), then it is
carried out by the ALU.
9) In order for a computer to be accessible over a computer network, the computer needs its own
A) MODEM
B) communication line
C) network address
D) packet
E) router
Answer: C
Explanation: C) In order to differentiate between the computers on a network, each is given its
own, unique, network address. In this way, a message intended for one computer can be
recognized by that computer through the message's destination address. A MODEM is a device
that is used to allow a computer to communicate to another computer over a telephone line. A
communication line is the network media itself. A packet is a collection of data that is sent over
a network. A router is a hardware device used to take a message from one network and move it
to another based on the message's destination address.
10) For a computer to communicate over the Internet, it must use
A) the TCP protocol
B) the IP protocol
C) the combined TCP/IP protocol
D) the Ethernet protocol
E) the ARPANET protocol
Answer: C
Explanation: C) IP is the Internet Protocol, but the TCP (Transmission Control Protocol) also
must be used because it handles such problems as how to piece together packets of the same
message that arrive out of order. Ethernet is a LAN protocol, which might be used in addition to
TCP/IP in some networks, but it is not needed to communicate over the Internet. There is no
such thing as the ARPANET protocol.
4
Copyright © 2012 Pearson Education, Inc.
11) A URL (Universal Resource Locator) specifies the address of
A) a computer on any network
B) a computer on the Internet
C) a local area network (LAN) on the Internet
D) a document or other type of file on the Internet
E) a Java program on the Internet
Answer: D
Explanation: D) URLs are used to locate documents (or other types of files such as an image or
sound file) anywhere on the Internet. An URL contains the address of the LAN or WAN and the
specific computer from which the file is to be retrieved; it specifies the file's address, not just the
computer's address.
12) It is important to dissect a problem into manageable pieces before trying to solve the problem
because
A) most problems are too complex to be solved as a single, large activity
B) most problems are solved by multiple people and it is easy to assign each piece to a separate
person
C) it is easier to integrate small pieces of a program into one program than it is to integrate one
big chunk of code into one program
D) our first solution may not solve the problem correctly
E) all of the above
Answer: A
Explanation: A) Any interesting problem will be too complex to solve easily as a single activity.
By decomposing the problem, we can build small solutions for each piece and then integrate the
pieces. Answer D is true, but it is not the reason why we will break a problem into pieces.
13) Once we have implemented the solution, we are not done with the problem because
A) the solution may not be the best (most efficient)
B) the solution may have errors and need testing and fixing before we are done
C) the solution may, at a later date, need revising to handle new specifications
D) the solution may, at a later date, need revising because of new programming language
features
E) all of the above
Answer: E
Explanation: E) A program should not be considered as a finished product until we are
reasonably assured that it is efficient and error-free. Further, it is common that programs require
modification in the future because of a change to specifications or a change to the language or
computer running the program.
5
Copyright © 2012 Pearson Education, Inc.
14) Java is an example of a(n)
A) machine language
B) assembly language
C) high-level language
D) fourth generation language
E) both C and D
Answer: E
Explanation: E) While Java was created during the fourth generation, it is clearly also a high-
level language. Machine language is the executable language of a machine, with programs
written in 1s and 0s only. Assembly language uses mnemonics. Fourth generation languages are
tools wrapped inside of programs so that the user has the flexibility to write some code to
executed from within the program.
15) In the following list, which statement is not true regarding Java as a programming language?
A) It is a relatively recent language, having been introduced in 1995
B) It is a language whose programs do not require translating into machine language before they
are executed
C) It is an object-oriented programming language
D) It is a language that embraces the idea of writing programs to be executed using the World
Wide Web
E) All of the above are true
Answer: B
Explanation: B) All languages require translation into machine language. The other statements
are all true about Java.
16) Comments should
A) rephrase the code it explains in English
B) be insightful and explain what the instruction's intention is
C) only be included in code that is difficult to understand
D) be used to define variables whose names are not easy to understand
E) all of the above
Answer: B
Explanation: B) One might answer E, but that then includes A and C, making "all of the above"
incorrect. Comments should not rephrase in English what an instruction says, but instead should
explain what that instruction is doing in relation to the program. Introductory programmers often
have difficult explaining their code and wind up stating the obvious in their comments. While
l variables should have comments that
explain their use.
6
Copyright © 2012 Pearson Education, Inc.
17) The main method for a Java program is defined by
A) public static main( )
B) public static main(String[ ] args);
C) public static main(String[ ] args)
D) private static main(String[ ] args)
E) the main method could be defined as in A, C or D but not B
Answer: C
Explanation: C) In A, the parameter is missing. The parameters are defined later in the text, but
in effect, they allow the user to run the program and include some initial arguments if the
program calls for it. In B, the semicolon at the end of the statement is not allowed. In D,
"private" instead of "public" would make the program non-executable by anyone and thus makes
the definition meaningless.
18) The line of Java code "// System.out.println("Hello");" will
A) do nothing
B) cause "Hello" to be output
C) cause a syntax error
D) cause "(Hello)" to be output
E) there is no way to know without executing this line of code
Answer: A
Explanation: A) The characters "//" denote the beginning of a comment. The comment is not
compiled and so, nothing would happen when this code is executed.
19) The instruction: System.out.println("Hello World"); might best be commented as
A) // prints "Hello World" to the screen
B) // prints a message
C) // used to demonstrate an output message
D) //
E) // meaningless instruction
Answer: C
Explanation: C) Comments in A and B state the obvious while the comments in D and E are
meaningless. The comment in C explains why the instruction appears in the program.
20) Which character below is not allowed in an identifier?
A) $
B) _
C) 0 (zero)
D) q
E) ^
Answer: E
Explanation: E) Java identifiers can consist of any letter, digit, $ or _ as long as the identifier
starts with a letter or _. ^ is not a legal character.
7
Copyright © 2012 Pearson Education, Inc.
21) Which of the following is not syntactically legal in Java?
A) public class Foo
B) System.out.println("Hi");
C) { }
D) s t a t i c main(String[ ] args)
E) only B is legally valid, all of the rest are illegal
Answer: D
Explanation: D) The Java compiler would not recognize "s t a t i c" as "static" because the Java
compiler treats white space (blanks) as separators between entities. The other statements are all
legal, including "{ }" which is a block that happens to have no statements within it.
22) Which of the following is a legal Java identifier?
A) i
B) class
C) ilikeclass!
D) idon'tlikeclass
E) i-like-class
Answer: A
Explanation: A) Java identifiers cannot have the characters "!", "'" or "-" in them making answer
C, D and E wrong. The word "class" is a reserved word in Java and cannot be used as an
identifier. The identifier "i" is perfectly legal although it is not necessarily a good identifier since
it is not descriptive of its use.
23) A unique aspect of Java that allows code compiled on one machine to be executed on a
machine of a different hardware platform is Java's
A) bytecodes
B) syntax
C) use of objects
D) use of exception handling
E) all of the above
Answer: A
Explanation: A) The translation process for a Java program is to first compile it into bytecodes,
which are architecturally neutral (that is, they can be used no matter what the architectural
platform is). To execute the program, the bytecodes must be further compiled by a Java
compiler or interpreted by a Java Virtual Machine.
8
Copyright © 2012 Pearson Education, Inc.
24) Java is similar in syntax to what other high level language?
A) Pascal
B) Ada
C) C++
D) FORTRAN
E) BASIC
Answer: C
Explanation: C) The creators of Java decided to use syntax similar to C++ so that C++
programmers could easily learn Java. Variable declarations, assignment statements, loops,
selection statements and comments are among the features that have nearly identical syntax.
There are many differences however, so don't assume that any C or C++ programmer will easily
or instantly be able to program in Java.
25) An error in a program that results in the program outputting $100 instead of the correct
answer, $250 is
A) a programmer error
B) a syntax error
C) a run-time error
D) a logical error
E) a snafu
Answer: D
Explanation: D) While this is an error (answer A), programmers classify the type of error in
order to more easily solve the problem. Syntax errors are caught by the compiler and the
program cannot run without fixing all syntax errors. Run-time errors arise during program
execution and cause the program to stop running. Logical errors are errors whereby the program
can run to completion, but gives the wrong answer. If the result should have been $250, then the
logic of the program is wrong since it output $100. A snafu is a term expressing a messed up
situation in combat and should not be used by respectable programmers!
26) Which of the following is true regarding Java syntax and semantics?
A) a Java compiler can determine if you have followed proper syntax but not proper semantics
B) a Java compiler can determine if you have followed proper semantics but not proper syntax
C) a Java compiler can determine if you have followed both proper syntax and semantics
D) a Java compiler cannot determine if you have followed either proper syntax or semantics
E) a Java compiler can determine if you have followed proper syntax and can determine if you
have followed proper semantics if you follow the Java naming convention rules
Answer: A
Explanation: A) Compilers for all languages have the ability to detect syntax errors because
improper use of the syntax leads to situations where the compilers cannot translate the code
properly. However, compilers are unable to follow the semantics of a program because this
requires a degree of understanding what the program is intended to do and computers have no
sense of understanding (at least at this point).
9
Copyright © 2012 Pearson Education, Inc.
27) Following Java naming convention, which of the following would be the best name for a
class about store customers?
A) StoreCustomer
B) Store Customer
C) storeCustomer
D) STORE_CUSTOMER
E) Store-Customer
Answer: A
Explanation: A) The Java naming convention states that classes should all start with an upper
case letter and that multiple-word names should start each new name with an upper case letter
while the remaining characters are lower case. Words should either be connected together
without spaces, or connected with the "_" character. Answers B and E are not legal names, and
using Java naming convention, C would qualify as a variable name and D would qualify as a
constant.
28) Which of the following would be a good variable name for the current value of a stock?
A) curstoval
B) theCurrentValueOfThisStockIs
C) currentStockVal
D) csv
E) current
Answer: C
Explanation: C) Java allows long variable names but the programmer must find a good
compromise between an excessive long name (as with B) and names too short to understand their
use (A and D). The name current possibly might be reasonable if there are no other "current"
values being referenced in the program.
29) Which of the following is a legal Java identifier?
A) 1ForAll
B) oneForAll
C) one/4/all
D) 1_4_all
E) 1forall
Answer: B
Explanation: B) Java identifiers cannot start with a number (so the answers in A, D and E are
illegal) and cannot include the "/" character, so the answer in C is illegal.
10
Copyright © 2012 Pearson Education, Inc.
30) A color image is broken down into individual pixels (points), each of which is represented by
A) a 1 for white and a 0 for black
B) 3 values denoting the intensity of red, green, and blue in the image
C) a single number indicating the intensity of color between white and black
D) two numbers, a value that denotes where between white and black the color is, and a
brightness
E) none of the above, it is not possible to represent a color image
Answer: B
Explanation: B) Black and white images are stored using 0s and 1s while color images are
stored using three values, one each for the degree of red, the degree of blue, and the degree of
green.
31) Which of the following characters does not need to have an associated "closing" character in
a Java program?
A) {
B) (
C) [
D) <
E) all of these require closing characters
Answer: D
Explanation: D) { is used to open a block, and so } is needed to close the block. ( is used to
open an expression and so ) is needed to close an expression. [ is used to start an array index so ]
is needed to close the array index. < is "less than" and > is "greater than" and these are not
needed together, so < requires no closing character.
32) Mistyping "println" as "printn" will result in
A) a syntax error
B) a run-time error
C) a logical error
D) no error at all
E) converting the statement into a comment
Answer: A
Explanation: A) If the Java compiler cannot make sense of a command, the compiler cannot
convert it and responds with a syntax error. While "println" is recognized as a command,
"printn" is not, and so the compiler provides a syntax error.
11
Copyright © 2012 Pearson Education, Inc.
1.2 True/False Questions
1) All information is stored in the computer using binary numbers.
Answer: TRUE
Explanation: The computer is a digital device meaning that it stores information in one of two
states using binary. We must determine then how to represent meaningful information (such as a
name or a program instruction or an image) in binary.
2) Java is an object-oriented programming language.
Answer: TRUE
Explanation: Java is classified as a high-level programming language but it is also classified as
an object-oriented programming language because it allows the programmer to implement data
structures as classes.
3) System.out.print is used in a program to denote that a documentation comment follows.
Answer: FALSE
Explanation: Documentation comments follow // marks or are embedded between /* and */.
System.out.print is an instruction used to output a message to the screen (the Java console
window).
4) Java byte codes are directly executable whereas Java source code is not.
Answer: FALSE
Explanation: Neither Java source code nor Java byte codes are executable. Both must be
compiled or interpreted into machine code. Java byte codes are useful however in that they are
machine-independent but semi-compiled code that allows your Java code to be transmitted over
the Internet and executed on another computer even if that other computer is a completely
different type.
5) The Java compiler is able to find all programmer errors.
Answer: FALSE
Explanation: The Java compiler can find syntax errors but cannot find either logical errors
(errors that are caused because of poor logic in writing the program) or run-time errors (errors
that arise during the execution of the program).
6) Java is a case-sensitive language meaning that Current, current and CURRENT will all
reference the same identifier.
Answer: FALSE
Explanation: Java is case sensitive which means that Current, current and CURRENT will all be
recognized as different identifiers. This causes problems with careless programmers who do not
spell an identifier consistently in terms of upper and lower case characters.
7) Code placed inside of comments will not be compiled and therefore will not execute.
Answer: TRUE
Explanation: The compiler discards comments; therefore, any code inside a comment is
discarded and is not compiled. Your executable program consists only of the code that is
compiled.
12
Copyright © 2012 Pearson Education, Inc.
8) The word "Public" is a reserved word.
Answer: FALSE
Explanation: "public" is a reserved word, but since Java is case sensitive, "Public" differs from
"public" and therefore "Public" is not a reserved word.
9) Reserved words in Java can be redefined by the programmer to mean something other than
their original intentions.
Answer: FALSE
Explanation: Java reserved words cannot be redefined.
10) In a Java program, dividing by 0 is a syntax error.
Answer: FALSE
Explanation: Dividing by 0 is not detected at compile time, and because a computer cannot
divide by 0, this is a run-time error.
11) During translation, the compiler puts its output (the compiled Java program) into ROM.
Answer: FALSE
Explanation: ROM stands for read-only-memory. The compiled output (the byte codes) may be
placed into RAM (writable random access memory) or into a file (on your hard drive, for
example).
12) Objects are defined by a class that describes the characteristics common to all instances of
the class.
Answer: TRUE
Explanation: "An object is an instance of a class." And, the purpose of a class is to describe
these common characteristics.
13) Inheritance is a form of software reuse.
Answer: TRUE
Explanation: Inheritance allows us to capitalize on the similarities among various kinds of
classes that have a common base (parent) class. Thus we reuse the base class each time a class
inherits from it.
14) Polymorphism is the idea that we can refer to multiple types of related objects in consistent
ways.
Answer: TRUE
Explanation: Polymorphism allows us to use the same name for similar behaviors that occur
among diverse and possibly unrelated objects. For example, to "open" may refer to a file, or to a
device, or to a communications line, etc. The same term, "open," is being used
objects that are being opened are quite different.
15) In Java, identifiers may be of any length up to a limit determined by the compiler.
Answer: FALSE
Explanation: Java (and Java compilers) do not limit the length of the identifiers you use.
Identifiers may be as long as you wish. Good programming practice, however, will limit the
lengths of the identifiers you create.
13
Copyright © 2012 Pearson Education, Inc.
1.3 Free-Form Questions
1) What is wrong with the following class definition?
public class Program1
{
public static void main(String[ ] args)
{
System.out.println("My first Java program")
}
}
Answer: The one executable statement in the main method is missing a ";" at the end of the line.
Executable statements end with ";".
2) What is wrong with the following class definition?
public class Program2
public static void main(String[ ] args)
{
System.out.println("My second Java program");
}
Answer: The definition of a class is placed within { } statements, which are missing here.
3) Given the following class definition, what are the reserved words and what are the identifiers?
public class Program3
{
public static void main(String[ ] args)
{
System.out.println("My third Java program");
}
}
Answer: The reserved words are public, class, static, void. The identifiers are main, String,
System, out, Program3, and args. Main is the name of a method defined within the Program3
class. String and System.out are classes already defined in Java and println is a method of
System.out. Program3 is a class, defined here, and args is a variable.
4) Provide a brief explanation of the role of main memory, the control unit, the arithmetic logic
unit, and registers. (see figure 1.13)
Answer: Main memory is used to store the currently executing processes along with their data.
The control unit performs the fetch-decode-execute cycle, which fetches an instruction from
memory, decodes it and determines how it is to be executed. The arithmetic logic unit comprises
a number of circuits that execute arithmetic and logic instructions. Registers are used to store
values in the CPU temporarily while the current instruction(s) need them.
14
Copyright © 2012 Pearson Education, Inc.
5) What is the output of the following when the main method is executed?
public class Question4
{
public static void main(String[ ] args)
{
System.out.println("hi there");
System.out.println(" ");
System.out.println("how are you doing today? ");
}
}
Answer: hi there
how are you doing today?
Notice that while the Java compiler ignores "white space", blanks that appear in a println
statement inside of quote marks are retained and output in that manner.
6) What is wrong with the following println statement?
System.out.println("My fourth Java Program);
Answer: It is missing a closing ". The compiler will look for a second " before the end of the
statement. So, like { }, ( ), and [ ], an initial " must have a corresponding closing ".
7) Provide identifier names that would be used to represent a person's social security number,
income tax withheld, and net pay.
Answer: socialSecurityNumber, or ssn, incomeTaxWithheld or incomeTax, and netPay all
would be reasonable.
8) There are a number of reserved words in Java that have no current meaning (denoted with an *
in figure 1.18). Why?
Answer: Java language designers anticipate introducing these statements in future versions, but
have not yet implemented them because they are lower priority, or it has not been decided how
they will be implemented or precisely what they will mean.
9) Rewrite the following comment so that it can appear over multiple lines.
// This is one really enormously long comment that might run off the page
Answer: We can do this in two ways, preceding each line with // or by enclosing the comment in
/* and */
/* This is one really enormously
long comment that might run
off the page */
// This is one really enormously
// long comment that might run
// off the page
15
Copyright © 2012 Pearson Education, Inc.
10) Examine figure 1.7 before answering this question. What 8-bit value comes immediately
before and what 8-bit value comes immediately after 10010111?
Answer: 10010110 comes immediately before 10010111 and 10010100 comes immediately
after 10010111.
11) Rewrite the following program with better formatting to make it easier to read.
public
class
MyProgram
{ public static void
main(
String[ ]
args)
{ System.out.println(
"Wow, this is messed up!"
);
} }
Answer: There are many ways this program might appear. The following would be very
acceptable:
public class MyProgram
{
public static void main(String[ ] args)
{
System.out.println("Wow, this is messed up!");
}
}
12) A document of text is 15 pages long. Each page contains approximately 200 words and the
average length of each word is 5 characters. Also assume one blank space between each word
and no punctuation. How many bytes will it take to store this document in memory or on disk
using ASCII?
Answer: A character is stored in ASCII using 8 bits or 1 byte. Therefore, 5 characters per word
plus 1 blank space between words take 6 bytes per word (except for the first). Each page stores
200 words and there are 15 pages. So we need 15 * 200 * 6 - 1 (no blank space to start the text)
= 17,999 bytes which is 17.58 kilobytes, or nearly 18 Kbytes.
16
Copyright © 2012 Pearson Education, Inc.
13) Provide a brief description of the roles of the following hardware elements (that is, what each
is used for):
a) CPU
b) Main memory
c) Secondary memory devices
d) Input/Output devices
s this through
the fetch-decode-execute cycle where the next program instruction is fetched from memory,
decoded in the CPU, and then executed by one or more circuits. b) Main memory is stored on
chips on the motherboard and is used for quick access to the current program for the fetch-
decode-execute cycle and to store data being used by this program. c) Secondary memory
devices are storage devices, used to store programs and data not currently being used. Storage
devices, such as the hard disk, also are used to store things for permanence and archives. d)
Input/Output devices are used to communicate with the computer. Input devices, like the
keyboard, take commands and data from the user and output devices, like the monitor, display
the results of the process/computation.
14) Considering that the Pentium IV processor runs at a clock speed of about 850 MHz. What
clock speed might we expect from a Pentium chip that would be released in 3 years?
Answer: 3400 MHz or 3.4 GHz. Explanation: The speed of processors has been doubling
roughly every 18 months (1 1/2 years). So, in 3 years, the speed will probably have doubled
twice, or be four times greater than it is now, 4 * 850 = 3400.
15) Write a Java program that will output on two separate lines the names of the authors of this
textbook.
Answer: public class OutputNames
{
public static void main(String[ ] args)
{
System.out.println("John Lewis"); // output first author's name
System.out.println("William Loftus"); // output second author's name
}
}
Random documents with unrelated
content Scribd suggests to you:
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the
free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only
be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E. Unless you have removed all references to Project
Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.
1.E.2. If an individual Project Gutenberg™ electronic work is
derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is
posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or
providing access to or distributing Project Gutenberg™
electronic works provided that:
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.
• You provide, in accordance with paragraph 1.F.3, a full refund of
any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project
Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except
for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set
forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.
The Foundation’s business office is located at 809 North 1500
West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws
regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.
While we cannot and do not solicit contributions from states
where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot
make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.
Please check the Project Gutenberg web pages for current
donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.
Section 5. General Information About
Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.
Project Gutenberg™ eBooks are often created from several
printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
This website includes information about Project Gutenberg™,
including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
testbankmall.com

Test Bank for Java Software Solutions 7th Edition (International Edition). John Lewis / William Loftus

  • 1.
    Test Bank forJava Software Solutions 7th Edition (International Edition). John Lewis / William Loftus download https://testbankmall.com/product/test-bank-for-java-software- solutions-7th-edition-international-edition-john-lewis-william- loftus/ Find test banks or solution manuals at testbankmall.com today!
  • 2.
    Here are somerecommended products for you. Click the link to download, or explore more at testbankmall.com Test Bank for Java Software Solutions, 9th Edition John Lewis William Loftus https://testbankmall.com/product/test-bank-for-java-software- solutions-9th-edition-john-lewis-william-loftus/ Test Bank for Java Software Solutions: Foundations of Program Design, 7/E 7th Edition John Lewis, William Loftus https://testbankmall.com/product/test-bank-for-java-software- solutions-foundations-of-program-design-7-e-7th-edition-john-lewis- william-loftus/ Solution manual for Java Software Solutions for AP Computer Science A, 2/E 2nd Edition John Lewis, William Loftus, Cara Cocking https://testbankmall.com/product/solution-manual-for-java-software- solutions-for-ap-computer-science-a-2-e-2nd-edition-john-lewis- william-loftus-cara-cocking/ Experiments in Physiology 11th Edition Woodman Solutions Manual https://testbankmall.com/product/experiments-in-physiology-11th- edition-woodman-solutions-manual/
  • 3.
    Elementary Statistics AStep By Step Approach Bluman 8th Edition Solutions Manual https://testbankmall.com/product/elementary-statistics-a-step-by-step- approach-bluman-8th-edition-solutions-manual/ Test Bank for The World of Psychology, Eighth Canadian Edition https://testbankmall.com/product/test-bank-for-the-world-of- psychology-eighth-canadian-edition/ Test Bank For Business Law: Text and Cases 14th Edition https://testbankmall.com/product/test-bank-for-business-law-text-and- cases-14th-edition/ Maternal-Child Nursing Care, 1st Edition Test Bank https://testbankmall.com/product/maternal-child-nursing-care-1st- edition-test-bank/ Test Bank for The Economics of Money, Banking and Financial Markets 12th Edition Mishkin https://testbankmall.com/product/test-bank-for-the-economics-of-money- banking-and-financial-markets-12th-edition-mishkin/
  • 4.
    Solution Manual forBusiness, 12th Edition https://testbankmall.com/product/solution-manual-for-business-12th- edition/
  • 5.
    2 Copyright © 2012Pearson Education, Inc. 4) Which memory capacity is the largest? A) 1,500,000,000,000 bytes B) 100 gigabytes C) 3,500,000 kilobytes D) 10 terabyte E) 12,000,000 megabytes Answer: E Explanation: E) We convert each of these capacities to bytes (rounding off) to compare them. The value in A remains the same, 1 1/2 trillion bytes. The value in B is 100 billion bytes. The value in C is 3 1/2 billion bytes. The value in D is 10 trillion bytes. The answer in E is 12 trillion bytes. 5) Binary numbers are composed entirely of A) 0s B) 1s C) 0s and 1s D) 0s, 1s and 2s E) any digits between 0 and 9 Answer: C Explanation: C) Binary is base 2. In Mathematics, numbers in base n are composed entirely of digits between 0 and n-1. 6) Volatility is a property of A) RAM B) ROM C) disk D) software E) computer networks Answer: A Explanation: A) Volatility means that the contents of memory are lost if the electrical power is shut off. This is true of RAM (Random Access Memory), but not ROM (Read Only Memory) or disk. Software and computer networks are not forms of memory. 7) The ability to directly obtain a stored item by referencing its address is known as A) random access B) sequential access C) read-only access D) fetch access E) volatility Answer: A Explanation: A) Random access is meant to convey the idea that accessing any item is equally easy, and that any item is retrievable based solely on its address. Random access is the form of access used by both RAM and ROM memory. Disk access, called direct access, is a similar idea, and direct and random access are sometimes referred to synonymously. Sequential access is used by tape.
  • 6.
    3 Copyright © 2012Pearson Education, Inc. 8) Which phase of the fetch-decode-execute cycle might use a circuit in the arithmetic-logic unit? A) fetch B) decode C) execute D) during fetch or execute, but not decode E) could be used in fetch, decode or execute phase Answer: C Explanation: C) The fetch phase retrieves (fetches) the next program instruction from memory. The decode phase determines which circuit(s) needs to be used to execute the instruction. The instruction is executed during the execute phase. If the instruction is either an arithmetic operation (like add or multiply) or a logical operation (like comparing two values), then it is carried out by the ALU. 9) In order for a computer to be accessible over a computer network, the computer needs its own A) MODEM B) communication line C) network address D) packet E) router Answer: C Explanation: C) In order to differentiate between the computers on a network, each is given its own, unique, network address. In this way, a message intended for one computer can be recognized by that computer through the message's destination address. A MODEM is a device that is used to allow a computer to communicate to another computer over a telephone line. A communication line is the network media itself. A packet is a collection of data that is sent over a network. A router is a hardware device used to take a message from one network and move it to another based on the message's destination address. 10) For a computer to communicate over the Internet, it must use A) the TCP protocol B) the IP protocol C) the combined TCP/IP protocol D) the Ethernet protocol E) the ARPANET protocol Answer: C Explanation: C) IP is the Internet Protocol, but the TCP (Transmission Control Protocol) also must be used because it handles such problems as how to piece together packets of the same message that arrive out of order. Ethernet is a LAN protocol, which might be used in addition to TCP/IP in some networks, but it is not needed to communicate over the Internet. There is no such thing as the ARPANET protocol.
  • 7.
    4 Copyright © 2012Pearson Education, Inc. 11) A URL (Universal Resource Locator) specifies the address of A) a computer on any network B) a computer on the Internet C) a local area network (LAN) on the Internet D) a document or other type of file on the Internet E) a Java program on the Internet Answer: D Explanation: D) URLs are used to locate documents (or other types of files such as an image or sound file) anywhere on the Internet. An URL contains the address of the LAN or WAN and the specific computer from which the file is to be retrieved; it specifies the file's address, not just the computer's address. 12) It is important to dissect a problem into manageable pieces before trying to solve the problem because A) most problems are too complex to be solved as a single, large activity B) most problems are solved by multiple people and it is easy to assign each piece to a separate person C) it is easier to integrate small pieces of a program into one program than it is to integrate one big chunk of code into one program D) our first solution may not solve the problem correctly E) all of the above Answer: A Explanation: A) Any interesting problem will be too complex to solve easily as a single activity. By decomposing the problem, we can build small solutions for each piece and then integrate the pieces. Answer D is true, but it is not the reason why we will break a problem into pieces. 13) Once we have implemented the solution, we are not done with the problem because A) the solution may not be the best (most efficient) B) the solution may have errors and need testing and fixing before we are done C) the solution may, at a later date, need revising to handle new specifications D) the solution may, at a later date, need revising because of new programming language features E) all of the above Answer: E Explanation: E) A program should not be considered as a finished product until we are reasonably assured that it is efficient and error-free. Further, it is common that programs require modification in the future because of a change to specifications or a change to the language or computer running the program.
  • 8.
    5 Copyright © 2012Pearson Education, Inc. 14) Java is an example of a(n) A) machine language B) assembly language C) high-level language D) fourth generation language E) both C and D Answer: E Explanation: E) While Java was created during the fourth generation, it is clearly also a high- level language. Machine language is the executable language of a machine, with programs written in 1s and 0s only. Assembly language uses mnemonics. Fourth generation languages are tools wrapped inside of programs so that the user has the flexibility to write some code to executed from within the program. 15) In the following list, which statement is not true regarding Java as a programming language? A) It is a relatively recent language, having been introduced in 1995 B) It is a language whose programs do not require translating into machine language before they are executed C) It is an object-oriented programming language D) It is a language that embraces the idea of writing programs to be executed using the World Wide Web E) All of the above are true Answer: B Explanation: B) All languages require translation into machine language. The other statements are all true about Java. 16) Comments should A) rephrase the code it explains in English B) be insightful and explain what the instruction's intention is C) only be included in code that is difficult to understand D) be used to define variables whose names are not easy to understand E) all of the above Answer: B Explanation: B) One might answer E, but that then includes A and C, making "all of the above" incorrect. Comments should not rephrase in English what an instruction says, but instead should explain what that instruction is doing in relation to the program. Introductory programmers often have difficult explaining their code and wind up stating the obvious in their comments. While l variables should have comments that explain their use.
  • 9.
    6 Copyright © 2012Pearson Education, Inc. 17) The main method for a Java program is defined by A) public static main( ) B) public static main(String[ ] args); C) public static main(String[ ] args) D) private static main(String[ ] args) E) the main method could be defined as in A, C or D but not B Answer: C Explanation: C) In A, the parameter is missing. The parameters are defined later in the text, but in effect, they allow the user to run the program and include some initial arguments if the program calls for it. In B, the semicolon at the end of the statement is not allowed. In D, "private" instead of "public" would make the program non-executable by anyone and thus makes the definition meaningless. 18) The line of Java code "// System.out.println("Hello");" will A) do nothing B) cause "Hello" to be output C) cause a syntax error D) cause "(Hello)" to be output E) there is no way to know without executing this line of code Answer: A Explanation: A) The characters "//" denote the beginning of a comment. The comment is not compiled and so, nothing would happen when this code is executed. 19) The instruction: System.out.println("Hello World"); might best be commented as A) // prints "Hello World" to the screen B) // prints a message C) // used to demonstrate an output message D) // E) // meaningless instruction Answer: C Explanation: C) Comments in A and B state the obvious while the comments in D and E are meaningless. The comment in C explains why the instruction appears in the program. 20) Which character below is not allowed in an identifier? A) $ B) _ C) 0 (zero) D) q E) ^ Answer: E Explanation: E) Java identifiers can consist of any letter, digit, $ or _ as long as the identifier starts with a letter or _. ^ is not a legal character.
  • 10.
    7 Copyright © 2012Pearson Education, Inc. 21) Which of the following is not syntactically legal in Java? A) public class Foo B) System.out.println("Hi"); C) { } D) s t a t i c main(String[ ] args) E) only B is legally valid, all of the rest are illegal Answer: D Explanation: D) The Java compiler would not recognize "s t a t i c" as "static" because the Java compiler treats white space (blanks) as separators between entities. The other statements are all legal, including "{ }" which is a block that happens to have no statements within it. 22) Which of the following is a legal Java identifier? A) i B) class C) ilikeclass! D) idon'tlikeclass E) i-like-class Answer: A Explanation: A) Java identifiers cannot have the characters "!", "'" or "-" in them making answer C, D and E wrong. The word "class" is a reserved word in Java and cannot be used as an identifier. The identifier "i" is perfectly legal although it is not necessarily a good identifier since it is not descriptive of its use. 23) A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is Java's A) bytecodes B) syntax C) use of objects D) use of exception handling E) all of the above Answer: A Explanation: A) The translation process for a Java program is to first compile it into bytecodes, which are architecturally neutral (that is, they can be used no matter what the architectural platform is). To execute the program, the bytecodes must be further compiled by a Java compiler or interpreted by a Java Virtual Machine.
  • 11.
    8 Copyright © 2012Pearson Education, Inc. 24) Java is similar in syntax to what other high level language? A) Pascal B) Ada C) C++ D) FORTRAN E) BASIC Answer: C Explanation: C) The creators of Java decided to use syntax similar to C++ so that C++ programmers could easily learn Java. Variable declarations, assignment statements, loops, selection statements and comments are among the features that have nearly identical syntax. There are many differences however, so don't assume that any C or C++ programmer will easily or instantly be able to program in Java. 25) An error in a program that results in the program outputting $100 instead of the correct answer, $250 is A) a programmer error B) a syntax error C) a run-time error D) a logical error E) a snafu Answer: D Explanation: D) While this is an error (answer A), programmers classify the type of error in order to more easily solve the problem. Syntax errors are caught by the compiler and the program cannot run without fixing all syntax errors. Run-time errors arise during program execution and cause the program to stop running. Logical errors are errors whereby the program can run to completion, but gives the wrong answer. If the result should have been $250, then the logic of the program is wrong since it output $100. A snafu is a term expressing a messed up situation in combat and should not be used by respectable programmers! 26) Which of the following is true regarding Java syntax and semantics? A) a Java compiler can determine if you have followed proper syntax but not proper semantics B) a Java compiler can determine if you have followed proper semantics but not proper syntax C) a Java compiler can determine if you have followed both proper syntax and semantics D) a Java compiler cannot determine if you have followed either proper syntax or semantics E) a Java compiler can determine if you have followed proper syntax and can determine if you have followed proper semantics if you follow the Java naming convention rules Answer: A Explanation: A) Compilers for all languages have the ability to detect syntax errors because improper use of the syntax leads to situations where the compilers cannot translate the code properly. However, compilers are unable to follow the semantics of a program because this requires a degree of understanding what the program is intended to do and computers have no sense of understanding (at least at this point).
  • 12.
    9 Copyright © 2012Pearson Education, Inc. 27) Following Java naming convention, which of the following would be the best name for a class about store customers? A) StoreCustomer B) Store Customer C) storeCustomer D) STORE_CUSTOMER E) Store-Customer Answer: A Explanation: A) The Java naming convention states that classes should all start with an upper case letter and that multiple-word names should start each new name with an upper case letter while the remaining characters are lower case. Words should either be connected together without spaces, or connected with the "_" character. Answers B and E are not legal names, and using Java naming convention, C would qualify as a variable name and D would qualify as a constant. 28) Which of the following would be a good variable name for the current value of a stock? A) curstoval B) theCurrentValueOfThisStockIs C) currentStockVal D) csv E) current Answer: C Explanation: C) Java allows long variable names but the programmer must find a good compromise between an excessive long name (as with B) and names too short to understand their use (A and D). The name current possibly might be reasonable if there are no other "current" values being referenced in the program. 29) Which of the following is a legal Java identifier? A) 1ForAll B) oneForAll C) one/4/all D) 1_4_all E) 1forall Answer: B Explanation: B) Java identifiers cannot start with a number (so the answers in A, D and E are illegal) and cannot include the "/" character, so the answer in C is illegal.
  • 13.
    10 Copyright © 2012Pearson Education, Inc. 30) A color image is broken down into individual pixels (points), each of which is represented by A) a 1 for white and a 0 for black B) 3 values denoting the intensity of red, green, and blue in the image C) a single number indicating the intensity of color between white and black D) two numbers, a value that denotes where between white and black the color is, and a brightness E) none of the above, it is not possible to represent a color image Answer: B Explanation: B) Black and white images are stored using 0s and 1s while color images are stored using three values, one each for the degree of red, the degree of blue, and the degree of green. 31) Which of the following characters does not need to have an associated "closing" character in a Java program? A) { B) ( C) [ D) < E) all of these require closing characters Answer: D Explanation: D) { is used to open a block, and so } is needed to close the block. ( is used to open an expression and so ) is needed to close an expression. [ is used to start an array index so ] is needed to close the array index. < is "less than" and > is "greater than" and these are not needed together, so < requires no closing character. 32) Mistyping "println" as "printn" will result in A) a syntax error B) a run-time error C) a logical error D) no error at all E) converting the statement into a comment Answer: A Explanation: A) If the Java compiler cannot make sense of a command, the compiler cannot convert it and responds with a syntax error. While "println" is recognized as a command, "printn" is not, and so the compiler provides a syntax error.
  • 14.
    11 Copyright © 2012Pearson Education, Inc. 1.2 True/False Questions 1) All information is stored in the computer using binary numbers. Answer: TRUE Explanation: The computer is a digital device meaning that it stores information in one of two states using binary. We must determine then how to represent meaningful information (such as a name or a program instruction or an image) in binary. 2) Java is an object-oriented programming language. Answer: TRUE Explanation: Java is classified as a high-level programming language but it is also classified as an object-oriented programming language because it allows the programmer to implement data structures as classes. 3) System.out.print is used in a program to denote that a documentation comment follows. Answer: FALSE Explanation: Documentation comments follow // marks or are embedded between /* and */. System.out.print is an instruction used to output a message to the screen (the Java console window). 4) Java byte codes are directly executable whereas Java source code is not. Answer: FALSE Explanation: Neither Java source code nor Java byte codes are executable. Both must be compiled or interpreted into machine code. Java byte codes are useful however in that they are machine-independent but semi-compiled code that allows your Java code to be transmitted over the Internet and executed on another computer even if that other computer is a completely different type. 5) The Java compiler is able to find all programmer errors. Answer: FALSE Explanation: The Java compiler can find syntax errors but cannot find either logical errors (errors that are caused because of poor logic in writing the program) or run-time errors (errors that arise during the execution of the program). 6) Java is a case-sensitive language meaning that Current, current and CURRENT will all reference the same identifier. Answer: FALSE Explanation: Java is case sensitive which means that Current, current and CURRENT will all be recognized as different identifiers. This causes problems with careless programmers who do not spell an identifier consistently in terms of upper and lower case characters. 7) Code placed inside of comments will not be compiled and therefore will not execute. Answer: TRUE Explanation: The compiler discards comments; therefore, any code inside a comment is discarded and is not compiled. Your executable program consists only of the code that is compiled.
  • 15.
    12 Copyright © 2012Pearson Education, Inc. 8) The word "Public" is a reserved word. Answer: FALSE Explanation: "public" is a reserved word, but since Java is case sensitive, "Public" differs from "public" and therefore "Public" is not a reserved word. 9) Reserved words in Java can be redefined by the programmer to mean something other than their original intentions. Answer: FALSE Explanation: Java reserved words cannot be redefined. 10) In a Java program, dividing by 0 is a syntax error. Answer: FALSE Explanation: Dividing by 0 is not detected at compile time, and because a computer cannot divide by 0, this is a run-time error. 11) During translation, the compiler puts its output (the compiled Java program) into ROM. Answer: FALSE Explanation: ROM stands for read-only-memory. The compiled output (the byte codes) may be placed into RAM (writable random access memory) or into a file (on your hard drive, for example). 12) Objects are defined by a class that describes the characteristics common to all instances of the class. Answer: TRUE Explanation: "An object is an instance of a class." And, the purpose of a class is to describe these common characteristics. 13) Inheritance is a form of software reuse. Answer: TRUE Explanation: Inheritance allows us to capitalize on the similarities among various kinds of classes that have a common base (parent) class. Thus we reuse the base class each time a class inherits from it. 14) Polymorphism is the idea that we can refer to multiple types of related objects in consistent ways. Answer: TRUE Explanation: Polymorphism allows us to use the same name for similar behaviors that occur among diverse and possibly unrelated objects. For example, to "open" may refer to a file, or to a device, or to a communications line, etc. The same term, "open," is being used objects that are being opened are quite different. 15) In Java, identifiers may be of any length up to a limit determined by the compiler. Answer: FALSE Explanation: Java (and Java compilers) do not limit the length of the identifiers you use. Identifiers may be as long as you wish. Good programming practice, however, will limit the lengths of the identifiers you create.
  • 16.
    13 Copyright © 2012Pearson Education, Inc. 1.3 Free-Form Questions 1) What is wrong with the following class definition? public class Program1 { public static void main(String[ ] args) { System.out.println("My first Java program") } } Answer: The one executable statement in the main method is missing a ";" at the end of the line. Executable statements end with ";". 2) What is wrong with the following class definition? public class Program2 public static void main(String[ ] args) { System.out.println("My second Java program"); } Answer: The definition of a class is placed within { } statements, which are missing here. 3) Given the following class definition, what are the reserved words and what are the identifiers? public class Program3 { public static void main(String[ ] args) { System.out.println("My third Java program"); } } Answer: The reserved words are public, class, static, void. The identifiers are main, String, System, out, Program3, and args. Main is the name of a method defined within the Program3 class. String and System.out are classes already defined in Java and println is a method of System.out. Program3 is a class, defined here, and args is a variable. 4) Provide a brief explanation of the role of main memory, the control unit, the arithmetic logic unit, and registers. (see figure 1.13) Answer: Main memory is used to store the currently executing processes along with their data. The control unit performs the fetch-decode-execute cycle, which fetches an instruction from memory, decodes it and determines how it is to be executed. The arithmetic logic unit comprises a number of circuits that execute arithmetic and logic instructions. Registers are used to store values in the CPU temporarily while the current instruction(s) need them.
  • 17.
    14 Copyright © 2012Pearson Education, Inc. 5) What is the output of the following when the main method is executed? public class Question4 { public static void main(String[ ] args) { System.out.println("hi there"); System.out.println(" "); System.out.println("how are you doing today? "); } } Answer: hi there how are you doing today? Notice that while the Java compiler ignores "white space", blanks that appear in a println statement inside of quote marks are retained and output in that manner. 6) What is wrong with the following println statement? System.out.println("My fourth Java Program); Answer: It is missing a closing ". The compiler will look for a second " before the end of the statement. So, like { }, ( ), and [ ], an initial " must have a corresponding closing ". 7) Provide identifier names that would be used to represent a person's social security number, income tax withheld, and net pay. Answer: socialSecurityNumber, or ssn, incomeTaxWithheld or incomeTax, and netPay all would be reasonable. 8) There are a number of reserved words in Java that have no current meaning (denoted with an * in figure 1.18). Why? Answer: Java language designers anticipate introducing these statements in future versions, but have not yet implemented them because they are lower priority, or it has not been decided how they will be implemented or precisely what they will mean. 9) Rewrite the following comment so that it can appear over multiple lines. // This is one really enormously long comment that might run off the page Answer: We can do this in two ways, preceding each line with // or by enclosing the comment in /* and */ /* This is one really enormously long comment that might run off the page */ // This is one really enormously // long comment that might run // off the page
  • 18.
    15 Copyright © 2012Pearson Education, Inc. 10) Examine figure 1.7 before answering this question. What 8-bit value comes immediately before and what 8-bit value comes immediately after 10010111? Answer: 10010110 comes immediately before 10010111 and 10010100 comes immediately after 10010111. 11) Rewrite the following program with better formatting to make it easier to read. public class MyProgram { public static void main( String[ ] args) { System.out.println( "Wow, this is messed up!" ); } } Answer: There are many ways this program might appear. The following would be very acceptable: public class MyProgram { public static void main(String[ ] args) { System.out.println("Wow, this is messed up!"); } } 12) A document of text is 15 pages long. Each page contains approximately 200 words and the average length of each word is 5 characters. Also assume one blank space between each word and no punctuation. How many bytes will it take to store this document in memory or on disk using ASCII? Answer: A character is stored in ASCII using 8 bits or 1 byte. Therefore, 5 characters per word plus 1 blank space between words take 6 bytes per word (except for the first). Each page stores 200 words and there are 15 pages. So we need 15 * 200 * 6 - 1 (no blank space to start the text) = 17,999 bytes which is 17.58 kilobytes, or nearly 18 Kbytes.
  • 19.
    16 Copyright © 2012Pearson Education, Inc. 13) Provide a brief description of the roles of the following hardware elements (that is, what each is used for): a) CPU b) Main memory c) Secondary memory devices d) Input/Output devices s this through the fetch-decode-execute cycle where the next program instruction is fetched from memory, decoded in the CPU, and then executed by one or more circuits. b) Main memory is stored on chips on the motherboard and is used for quick access to the current program for the fetch- decode-execute cycle and to store data being used by this program. c) Secondary memory devices are storage devices, used to store programs and data not currently being used. Storage devices, such as the hard disk, also are used to store things for permanence and archives. d) Input/Output devices are used to communicate with the computer. Input devices, like the keyboard, take commands and data from the user and output devices, like the monitor, display the results of the process/computation. 14) Considering that the Pentium IV processor runs at a clock speed of about 850 MHz. What clock speed might we expect from a Pentium chip that would be released in 3 years? Answer: 3400 MHz or 3.4 GHz. Explanation: The speed of processors has been doubling roughly every 18 months (1 1/2 years). So, in 3 years, the speed will probably have doubled twice, or be four times greater than it is now, 4 * 850 = 3400. 15) Write a Java program that will output on two separate lines the names of the authors of this textbook. Answer: public class OutputNames { public static void main(String[ ] args) { System.out.println("John Lewis"); // output first author's name System.out.println("William Loftus"); // output second author's name } }
  • 20.
    Random documents withunrelated content Scribd suggests to you:
  • 21.
    PLEASE READ THISBEFORE YOU DISTRIBUTE OR USE THIS WORK To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase “Project Gutenberg”), you agree to comply with all the terms of the Full Project Gutenberg™ License available with this file or online at www.gutenberg.org/license. Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works 1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8. 1.B. “Project Gutenberg” is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
  • 22.
    1.C. The ProjectGutenberg Literary Archive Foundation (“the Foundation” or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is unprotected by copyright law in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others. 1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country other than the United States. 1.E. Unless you have removed all references to Project Gutenberg: 1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase “Project
  • 23.
    Gutenberg” appears, orwith which the phrase “Project Gutenberg” is associated) is accessed, displayed, performed, viewed, copied or distributed: This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook. 1.E.2. If an individual Project Gutenberg™ electronic work is derived from texts not protected by U.S. copyright law (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase “Project Gutenberg” associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9. 1.E.3. If an individual Project Gutenberg™ electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg™ License for all works posted with the permission of the copyright holder found at the beginning of this work. 1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ License terms from this work, or any files
  • 24.
    containing a partof this work or any other work associated with Project Gutenberg™. 1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1 with active links or immediate access to the full terms of the Project Gutenberg™ License. 1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg™ work in a format other than “Plain Vanilla ASCII” or other format used in the official version posted on the official Project Gutenberg™ website (www.gutenberg.org), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original “Plain Vanilla ASCII” or other form. Any alternate format must include the full Project Gutenberg™ License as specified in paragraph 1.E.1. 1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg™ works unless you comply with paragraph 1.E.8 or 1.E.9. 1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg™ electronic works provided that: • You pay a royalty fee of 20% of the gross profits you derive from the use of Project Gutenberg™ works calculated using the method you already use to calculate your applicable taxes. The fee is owed to the owner of the Project Gutenberg™ trademark, but he has agreed to donate royalties under this paragraph to the Project Gutenberg Literary Archive Foundation. Royalty
  • 25.
    payments must bepaid within 60 days following each date on which you prepare (or are legally required to prepare) your periodic tax returns. Royalty payments should be clearly marked as such and sent to the Project Gutenberg Literary Archive Foundation at the address specified in Section 4, “Information about donations to the Project Gutenberg Literary Archive Foundation.” • You provide a full refund of any money paid by a user who notifies you in writing (or by e-mail) within 30 days of receipt that s/he does not agree to the terms of the full Project Gutenberg™ License. You must require such a user to return or destroy all copies of the works possessed in a physical medium and discontinue all use of and all access to other copies of Project Gutenberg™ works. • You provide, in accordance with paragraph 1.F.3, a full refund of any money paid for a work or a replacement copy, if a defect in the electronic work is discovered and reported to you within 90 days of receipt of the work. • You comply with all other terms of this agreement for free distribution of Project Gutenberg™ works. 1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™ electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from the Project Gutenberg Literary Archive Foundation, the manager of the Project Gutenberg™ trademark. Contact the Foundation as set forth in Section 3 below. 1.F. 1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread works not protected by U.S. copyright
  • 26.
    law in creatingthe Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain “Defects,” such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment. 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the “Right of Replacement or Refund” described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund.
  • 27.
    If the secondcopy is also defective, you may demand a refund in writing without further opportunities to fix the problem. 1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PURPOSE. 1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions. 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause. Section 2. Information about the Mission of Project Gutenberg™
  • 28.
    Project Gutenberg™ issynonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life. Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg™’s goals and ensuring that the Project Gutenberg™ collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg™ and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation information page at www.gutenberg.org. Section 3. Information about the Project Gutenberg Literary Archive Foundation The Project Gutenberg Literary Archive Foundation is a non- profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation’s EIN or federal tax identification number is 64-6221541. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state’s laws. The Foundation’s business office is located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up to date contact information can be found at the Foundation’s website and official page at www.gutenberg.org/contact
  • 29.
    Section 4. Informationabout Donations to the Project Gutenberg Literary Archive Foundation Project Gutenberg™ depends upon and cannot survive without widespread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine-readable form accessible by the widest array of equipment including outdated equipment. Many small donations ($1 to $5,000) are particularly important to maintaining tax exempt status with the IRS. The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To SEND DONATIONS or determine the status of compliance for any particular state visit www.gutenberg.org/donate. While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate. International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff. Please check the Project Gutenberg web pages for current donation methods and addresses. Donations are accepted in a number of other ways including checks, online payments and
  • 30.
    credit card donations.To donate, please visit: www.gutenberg.org/donate. Section 5. General Information About Project Gutenberg™ electronic works Professor Michael S. Hart was the originator of the Project Gutenberg™ concept of a library of electronic works that could be freely shared with anyone. For forty years, he produced and distributed Project Gutenberg™ eBooks with only a loose network of volunteer support. Project Gutenberg™ eBooks are often created from several printed editions, all of which are confirmed as not protected by copyright in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition. Most people start at our website which has the main PG search facility: www.gutenberg.org. This website includes information about Project Gutenberg™, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.
  • 31.
    Welcome to ourwebsite – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! testbankmall.com