Visit https://testbankmall.com to download the full version and
explore more testbank or solutions manual
Test Bank for Java Software Solutions 7th Edition
(International Edition). John Lewis / William
Loftus
_____ Click the link below to download _____
https://testbankmall.com/product/test-bank-for-java-
software-solutions-7th-edition-international-edition-john-
lewis-william-loftus/
Explore and download more testbank or solutions manual at testbankmall.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
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/
Test Bank for Java Software Solutions, 9th Edition John
Lewis
https://testbankmall.com/product/test-bank-for-java-software-
solutions-9th-edition-john-lewis/
Solution Manual for Java Software Solutions 9th by Lewis
https://testbankmall.com/product/solution-manual-for-java-software-
solutions-9th-by-lewis/
Test Bank for Java Foundations, 3/E 3rd Edition John
Lewis, Peter DePasquale, Joe Chase
https://testbankmall.com/product/test-bank-for-java-
foundations-3-e-3rd-edition-john-lewis-peter-depasquale-joe-chase/
Solution Manual for Java Foundations, 3/E – John Lewis,
Peter DePasquale & Joe Chase
https://testbankmall.com/product/solution-manual-for-java-
foundations-3-e-john-lewis-peter-depasquale-joe-chase/
Solution Manual for Java Foundations, 3/E 3rd Edition John
Lewis, Peter DePasquale, Joe Chase
https://testbankmall.com/product/solution-manual-for-java-
foundations-3-e-3rd-edition-john-lewis-peter-depasquale-joe-chase/
Test Bank for Java Foundations: Introduction to Program
Design and Data Structures, 4th Edition, John Lewis Peter
DePasquale Joe Chase
https://testbankmall.com/product/test-bank-for-java-foundations-
introduction-to-program-design-and-data-structures-4th-edition-john-
lewis-peter-depasquale-joe-chase/
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
}
}
17
Copyright © 2012 Pearson Education, Inc.
16) Correct all the syntax errors in the following program.
Public Class Program  A problem program
(
Public static voided main[Strings( ) args]
{
system.out.println('This program'); * oh, my... *
system.out.println('has several syntax errors'); * lots of errors *
}
)
Answer: public class Program // A problem program
{
public static void main(String[ ] args)
{
System.out.println("This program"); /* oh, my... */
System.out.println("has several syntax errors"); /* lots of errors */
}
}
17) Name five of the fundamental terms which encompass object-oriented programming.
Answer: There are seven terms to choose from: object, attribute, method, class, encapsulation,
inheritance, and polymorphism.
18) Write a Java program that will display the following three lines when it is run:
*
* * *
* * * * *
Answer: public class Stars
{
public static void main(String[ ] args)
{
System.out.println(" *");
System.out.println(" * * *");
System.out.println("* * * * *");
}
}
Exploring the Variety of Random
Documents with Different Content
too often tempted by mere prettiness of detail to forget the general
effect of his composition. In a staircase, where only the general
effect is seized, prettiness does not count, and the effect produced
should be strong, clear and telling.
For the same reason, a stair-carpet, if used, should be of one color,
without pattern. Masses of plain color are one of the chief means of
producing effect in any scheme of decoration.
When the floor of the hall is of marble or mosaic,—as, if possible, it
should be,—the design, like that of the walls, should be clear and
decided in outline (see Plate XXX). On the other hand, if the hall is
used as an antechamber and carpeted, the carpet should be of one
color, matching that on the stairs.
In many large houses the stairs are now built of stone or marble,
while the floor of the landings is laid in wood, apparently owing to
the idea that stone or marble floors are cold. In the tropically-heated
American house not even the most sensitive person could be chilled
by passing contact with a stone floor; but if it is thought to "look
cold," it is better to lay a rug or a strip of carpet on the landing than
to permit the proximity of two such different substances as wood
and stone.
Unless the stairs are of wood, that material should never be used for
the rail; nor should wooden stairs be put in a staircase of which the
walls are of stone, marble, or scagliola. If the stairs are of wood, it is
better to treat the walls with wood or plaster panelling. In simple
staircases the best wall-decoration is a wooden dado-moulding
nailed on the plaster, the dado thus formed being painted white, and
the wall above it in any uniform color. Continuous pattern, such as
that on paper or stuff hangings, is specially objectionable on the
walls of a staircase, since it disturbs the simplicity of composition
best fitted to this part of the house.
For the lighting of the hall there should be a lantern like that in the
vestibule, but more elaborate in design. This mode of lighting
harmonizes with the severe treatment of the walls and indicates at
once that the hall is not a living-room, but a thoroughfare.[33]
If lights be required on the stairs, they should take the form of fire-
gilt bronze sconces, as architectural as possible in design, without
any finikin prettiness of detail. (For good examples, see the
appliques in Plates V and XXXIV). It is almost impossible to obtain
well-designed appliques of this kind in America; but the increasing
interest shown in house-decoration will in time doubtless cause a
demand for a better type of gas and electric fixtures. Meantime,
unless imported sconces can be obtained, the plainest brass fixtures
should be chosen in preference to the more elaborate models now to
be found here.
Where the walls of a hall are hung with pictures, these should be
few in number, and decorative in composition and coloring. No
subject requiring thought and study is suitable in such a position.
The mythological or architectural compositions of the Italian and
French schools of the last two centuries, with their superficial graces
of color and design, are for this reason well suited to the walls of
halls and antechambers.
The same may be said of prints. These should not be used in a large
high-studded hall; but they look well in a small entranceway, if hung
on plain-tinted walls. Here again such architectural compositions as
Piranesi's, with their bold contrasts of light and shade, Marc
Antonio's classic designs, or some frieze-like procession, such as
Mantegna's "Triumph of Julius Caesar," are especially appropriate;
whereas the subtle detail of the German Little Masters, the
symbolism of Dürer's etchings and the graces of Marillier or Moreau
le Jeune would be wasted in a situation where there is small
opportunity for more than a passing glance.
In most American houses, the warming of hall and stairs is so amply
provided for that where there is a hall fireplace it is seldom used. In
country houses, where it is sometimes necessary to have special
means for heating the hall, the open fireplace is of more service; but
it is not really suited to such a situation. The hearth suggests an
idea of intimacy and repose that has no place in a thoroughfare like
the hall; and, aside from this question of fitness, there is a practical
objection to placing an open chimney-piece in a position where it is
exposed to continual draughts from the front door and from the
rooms giving upon the hall.
The best way of heating a hall is by means of a faience stove—not
the oblong block composed of shiny white or brown tiles seen in
Swiss and German pensions, but one of the fine old stoves of
architectural design still used on the Continent for heating the
vestibule and dining-room. In Europe, increased attention has of late
been given to the design and coloring of these stoves; and if better
known here, they would form an important feature in the decoration
of our halls. Admirable models may be studied in many old French
and German houses and on the borders of Switzerland and Italy;
while the museum at Parma contains several fine examples of the
rocaille period.
FRENCH ARMOIRE, LOUIS XIV PERIOD.
MUSEUM OF DECORATIVE ARTS, PARIS.
PLATE XXXIII.
T
X
THE DRAWING-ROOM, BOUDOIR, AND
MORNING-ROOM
he "with-drawing-room" of mediæval England, to which the lady
and her maidens retired from the boisterous festivities of the
hall, seems at first to have been merely a part of the bedchamber in
which the lord and lady slept. In time it came to be screened off
from the sleeping-room; then, in the king's palaces, it became a
separate room for the use of the queen and her damsels; and so, in
due course, reached the nobleman's castle, and established itself as
a permanent part of English house-planning.
In France the evolution of the salon seems to have proceeded on
somewhat different lines. During the middle ages and the early
Renaissance period, the more public part of the nobleman's life was
enacted in the hall, or grand'salle, while the social and domestic side
of existence was transferred to the bedroom. This was soon divided
into two rooms, as in England. In France, however, both these rooms
contained beds; the inner being the real sleeping-chamber, while in
the outer room, which was used not only for administering justice
and receiving visits of state, but for informal entertainments and the
social side of family life, the bedstead represented the lord's lit de
parade, traditionally associated with state ceremonial and feudal
privileges.
SALA DELLA MADDALENA, ROYAL PALACE,
GENOA.
XVIII CENTURY.
(ITALIAN DRAWING-ROOM IN ROCAILLE
STYLE.)
PLATE XXXIV.
The custom of having a state bedroom in which no one slept
(chambre de parade, as it was called) was so firmly established that
even in the engravings of Abraham Bosse, representing French life in
the reign of Louis XIII, the fashionable apartments in which card-
parties, suppers, and other entertainments are taking place,
invariably contain a bed.
In large establishments the chambre de parade was never used as a
sleeping-chamber except by visitors of distinction; but in small
houses the lady slept in the room which served as her boudoir and
drawing-room. The Renaissance, it is true, had introduced from Italy
the cabinet opening off the lady's chamber, as in the palaces of
Urbino and Mantua; but these rooms were at first seen only in kings'
palaces, and were, moreover, too small to serve any social purpose.
The cabinet of Catherine de' Medici at Blois is a characteristic
example.
Meanwhile, the gallery had relieved the grand'salle of some of its
numerous uses; and these two apartments seem to have satisfied all
the requirements of society during the Renaissance in France.
In the seventeenth century the introduction of the two-storied
Italian saloon produced a state apartment called a salon; and this,
towards the beginning of the eighteenth century, was divided into
two smaller rooms: one, the salon de compagnie, remaining a part
of the gala suite used exclusively for entertaining (see Plate XXXIV),
while the other—the salon de famille—became a family apartment
like the English drawing-room.
The distinction between the salon de compagnie and the salon de
famille had by this time also established itself in England, where the
state drawing-room retained its Italian name of salone, or saloon,
while the living-apartment preserved, in abbreviated form, the
mediæval designation of the lady's with-drawing-room.
Pains have been taken to trace as clearly as possible the mixed
ancestry of the modern drawing-room, in order to show that it is the
result of two distinct influences—that of the gala apartment and that
of the family sitting-room. This twofold origin has curiously affected
the development of the drawing-room. In houses of average size,
where there are but two living-rooms—the master's library, or "den,"
and the lady's drawing-room,—it is obvious that the latter ought to
be used as a salon de famille, or meeting-place for the whole family;
and it is usually regarded as such in England, where common sense
generally prevails in matters of material comfort and convenience,
and where the drawing-room is often furnished with a simplicity
which would astonish those who associate the name with white-and-
gold walls and uncomfortable furniture.
In modern American houses both traditional influences are seen.
Sometimes, as in England, the drawing-room is treated as a family
apartment, and provided with books, lamps, easy-chairs and writing-
tables. In other houses it is still considered sacred to gilding and
discomfort, the best room in the house, and the convenience of all
its inmates, being sacrificed to a vague feeling that no drawing-room
is worthy of the name unless it is uninhabitable. This is an instance
of the salon de compagnie having usurped the rightful place of the
salon de famille; or rather, if the bourgeois descent of the American
house be considered, it may be more truly defined as a remnant of
the "best parlor" superstition.
Whatever the genealogy of the American drawing-room, it must be
owned that it too often fails to fulfil its purpose as a family
apartment. It is curious to note the amount of thought and money
frequently spent on the one room in the house used by no one, or
occupied at most for an hour after a "company" dinner.
CONSOLE IN THE PETIT TRIANON,
VERSAILLES.
LATE LOUIS XV STYLE.
BUST OF LOUIS XVI, BY PAJOU.
PLATE XXXV.
To this drawing-room, from which the inmates of the house
instinctively flee as soon as their social duties are discharged, many
necessities are often sacrificed. The library, or den, where the
members of the family sit, may be furnished with shabby odds and
ends; but the drawing-room must have its gilt chairs covered with
brocade, its vitrines full of modern Saxe, its guipure curtains and
velvet carpet.
The salon de compagnie is out of place in the average house. Such a
room is needed only where the dinners or other entertainments
given are so large as to make it impossible to use the ordinary living-
rooms of the house. In the grandest houses of Europe the gala-
rooms are never thrown open except for general entertainments, or
to receive guests of exalted rank, and the spectacle of a dozen
people languishing after dinner in the gilded wilderness of a state
saloon is practically unknown.
The purpose for which the salon de compagnie is used necessitates
its being furnished in the same formal manner as other gala
apartments. Circulation must not be impeded by a multiplicity of
small pieces of furniture holding lamps or other fragile objects, while
at least half of the chairs should be so light and easily moved that
groups may be formed and broken up at will. The walls should be
brilliantly decorated, without needless elaboration of detail, since it is
unlikely that the temporary occupants of such a room will have time
or inclination to study its treatment closely. The chief requisite is a
gay first impression. To produce this, the wall-decoration should be
light in color, and the furniture should consist of a few strongly
marked pieces, such as handsome cabinets and consoles, bronze or
marble statues, and vases and candelabra of imposing proportions.
Almost all modern furniture is too weak in design and too finikin in
detail to look well in a gala drawing-room.[34] (For examples of
drawing-room furniture, see Plates VI, IX, XXXIV, and XXXV.)
Beautiful pictures or rare prints produce little effect on the walls of a
gala room, just as an accumulation of small objects of art, such as
enamels, ivories and miniatures, are wasted upon its tables and
cabinets. Such treasures are for rooms in which people spend their
days, not for those in which they assemble for an hour's
entertainment.
But the salon de compagnie, being merely a modified form of the
great Italian saloon, is a part of the gala suite, and any detailed
discussion of the decorative treatment most suitable to it would
result in a repetition of what is said in the chapter on Gala Rooms.
The lighting of the company drawing-room—to borrow its French
designation—should be evenly diffused, without the separate centres
of illumination needful in a family living-room. The proper light is
that of wax candles. Nothing has done more to vulgarize interior
decoration than the general use of gas and of electricity in the living-
rooms of modern houses. Electric light especially, with its harsh
white glare, which no expedients have as yet overcome, has taken
from our drawing-rooms all air of privacy and distinction. In
passageways and offices, electricity is of great service; but were it
not that all "modern improvements" are thought equally applicable
to every condition of life, it would be difficult to account for the
adoption of a mode of lighting which makes the salon look like a
railway-station, the dining-room like a restaurant. That such light is
not needful in a drawing-room is shown by the fact that electric
bulbs are usually covered by shades of some deep color, in order
that the glare may be made as inoffensive as possible.
SALON, PALACE OF FONTAINEBLEAU.
PLATE XXXVI.
The light in a gala apartment should be neither vivid nor
concentrated: the soft, evenly diffused brightness of wax candles is
best fitted to bring out those subtle modellings of light and shade to
which old furniture and objects of art owe half their expressiveness.
The treatment of the salon de compagnie naturally differs from that
of the family drawing-room: the latter is essentially a room in which
people should be made comfortable. There must be a well-appointed
writing-table; the chairs must be conveniently grouped about various
tables, each with its lamp;—in short, the furniture should be so
disposed that people are not forced to take refuge in their bedrooms
for lack of fitting arrangements in the drawing-room.
The old French cabinet-makers excelled in the designing and making
of furniture for the salon de famille. The term "French furniture"
suggests to the Anglo-Saxon mind the stiff appointments of the gala
room—heavy gilt consoles, straight-backed arm-chairs covered with
tapestry, and monumental marble-topped tables. Admirable furniture
of this kind was made in France; but in the grand style the Italian
cabinet-makers competed successfully with the French; whereas the
latter stood alone in the production of the simpler and more
comfortable furniture adapted to the family living-room. Among
those who have not studied the subject there is a general impression
that eighteenth-century furniture, however beautiful in design and
execution, was not comfortable in the modern sense. This is owing
to the fact that the popular idea of "old furniture" is based on the
appointments of gala rooms in palaces: visitors to Versailles or
Fontainebleau are more likely to notice the massive gilt consoles and
benches in the state saloons than the simple easy-chairs and work-
tables of the petits appartements. A visit to the Garde Meuble or to
the Musée des Arts Décoratifs of Paris, or the inspection of any
collection of French eighteenth-century furniture, will show the
versatility and common sense of the old French cabinet-makers.
They produced an infinite variety of small meubles, in which beauty
of design and workmanship were joined to simplicity and
convenience.
The old arm-chair, or bergère, is a good example of this
combination. The modern upholsterer pads and puffs his seats as
though they were to form the furniture of a lunatic's cell; and then,
having expanded them to such dimensions that they cannot be
moved without effort, perches their dropsical bodies on four little
casters. Any one who compares such an arm-chair to the
eighteenth-century bergère, with its strong tapering legs, its snugly-
fitting back and cushioned seat, must admit that the latter is more
convenient and more beautiful (see Plates VIII and XXXVII).
The same may be said of the old French tables—from desks, card
and work-tables, to the small guéridon just large enough to hold a
book and candlestick. All these tables were simple and practical in
design: even in the Louis XV period, when more variety of outline
and ornament was permitted, the strong structural lines were
carefully maintained, and it is unusual to see an old table that does
not stand firmly on its legs and appear capable of supporting as
much weight as its size will permit (see Louis XV writing-table in
Plate XLVI).
The French tables, cabinets and commodes used in the family
apartments were usually of inlaid wood, with little ornamentation
save the design of the marquetry—elaborate mounts of chiselled
bronze being reserved for the furniture of gala rooms (see Plate X).
Old French marquetry was exquisitely delicate in color and design,
while Italian inlaying of the same period, though coarser, was
admirable in composition. Old Italian furniture of the seventeenth
and eighteenth centuries was always either inlaid or carved and
painted in gay colors: chiselled mounts are virtually unknown in
Italy.
ROOM IN THE PALACE OF
FONTAINEBLEAU.
LOUIS XV PANELLING, LOUIS XVI
FURNITURE.
PLATE XXXVII.
The furniture of the eighteenth century in England, while not
comparable in design to the best French models, was well made and
dignified; and its angularity of outline is not out of place against the
somewhat cold and formal background of an Adam room.
English marquetry suffered from the poverty of ornament marking
the wall-decoration of the period. There was a certain timidity about
the decorative compositions of the school of Adam and Sheraton,
and in their scanty repertoire the laurel-wreath, the velarium and the
cornucopia reappear with tiresome frequency.
The use to which the family drawing-room is put should indicate the
character of its decoration. Since it is a room in which many hours of
the day are spent, and in which people are at leisure, it should
contain what is best worth looking at in the way of pictures, prints,
and other objects of art; while there should be nothing about its
decoration so striking or eccentric as to become tiresome when
continually seen. A fanciful style may be pleasing in apartments used
only for stated purposes, such as the saloon or gallery; but in a
living-room, decoration should be subordinate to the individual,
forming merely a harmonious but unobtrusive background (see
Plates XXXVI and XXXVII). Such a setting also brings out the full
decorative value of all the drawing-room accessories—screens,
andirons, appliques, and door and window-fastenings. A study of
any old French interior will show how much these details contributed
to the general effect of the room.
Those who really care for books are seldom content to restrict them
to the library, for nothing adds more to the charm of a drawing-room
than a well-designed bookcase: an expanse of beautiful bindings is
as decorative as a fine tapestry.
The boudoir is, properly speaking, a part of the bedroom suite, and
as such is described in the chapter on the Bedroom. Sometimes,
however, a small sitting-room adjoins the family drawing-room, and
this, if given up to the mistress of the house, is virtually the boudoir.
The modern boudoir is a very different apartment from its
eighteenth-century prototype. Though it may preserve the delicate
decorations and furniture suggested by its name, such a room is
now generally used for the prosaic purpose of interviewing servants,
going over accounts and similar occupations. The appointments
should therefore comprise a writing-desk, with pigeon-holes,
drawers, and cupboards, and a comfortable lounge, or lit de repos,
for resting and reading.
LIT DE REPOS, EARLY LOUIS XV PERIOD.
PLATE XXXVIII.
The lit de repos, which, except in France, has been replaced by the
clumsy upholstered lounge, was one of the most useful pieces of
eighteenth-century furniture (see Plate XXXVIII). As its name
implies, it is shaped somewhat like a bed, or rather like a cradle that
stands on four legs instead of swinging. It is made of carved wood,
sometimes upholstered, but often seated with cane (see Plate
XXXIX). In the latter case it is fitted with a mattress and with a
pillow-like cushion covered with some material in keeping with the
hangings of the room. Sometimes the duchesse, or upholstered
bergère with removable foot-rest in the shape of a square bench, is
preferred to the lit de repos; but the latter is the more elegant and
graceful, and it is strange that it should have been discarded in favor
of the modern lounge, which is not only ugly, but far less
comfortable.
LIT DE REPOS, LOUIS XV PERIOD.
PLATE XXXIX.
As the boudoir is generally a small room, it is peculiarly suited to the
more delicate styles of painting or stucco ornamentation described in
the third chapter. A study of boudoir-decoration in the last century,
especially in France, will show the admirable sense of proportion
regulating the treatment of these little rooms (see Plate XL). Their
adornment was naturally studied with special care by the painters
and decorators of an age in which women played so important a
part.
It is sometimes thought that the eighteenth-century boudoir was
always decorated and furnished in a very elaborate manner. This
idea originates in the fact, already pointed out, that the rooms
usually seen by tourists are those in royal palaces, or in such
princely houses as are thrown open to the public on account of their
exceptional magnificence. The same type of boudoir is continually
reproduced in books on architecture and decoration; and what is
really a small private sitting-room for the lady of the house,
corresponding with her husband's "den," has thus come to be
regarded as one of the luxuries of a great establishment.
The prints of Eisen, Marillier, Moreau le Jeune, and other book-
illustrators of the eighteenth century, show that the boudoir in the
average private house was, in fact, a simple room, gay and graceful
in decoration, but as a rule neither rich nor elaborate (see Plate XLI).
As it usually adjoined the bedroom, it was decorated in the same
manner, and even when its appointments were expensive all
appearance of costliness was avoided.[35]
The boudoir is the room in which small objects of art—prints,
mezzotints and gouaches—show to the best advantage. No detail is
wasted, and all manner of delicate effects in wood-carving,
marquetry, and other ornamentation, such as would be lost upon the
walls and furniture of a larger room, here acquire their full value.
One or two well-chosen prints hung on a background of plain color
will give more pleasure than a medley of photographs, colored
photogravures, and other decorations of the cotillon-favor type. Not
only do mediocre ornaments become tiresome when seen day after
day, but the mere crowding of furniture and gimcracks into a small
room intended for work and repose will soon be found fatiguing.
Many English houses, especially in the country, contain a useful
room called the "morning-room," which is well defined by Robert
Kerr, in The English Gentleman's House, as "the drawing-room in
ordinary." It is, in fact, a kind of undress drawing-room, where the
family may gather informally at all hours of the day. The out-of-door
life led in England makes it specially necessary to provide a sitting-
room which people are not afraid to enter in muddy boots and wet
clothes. Even if the drawing-room be not, as Mr. Kerr quaintly puts it,
"preserved"—that is, used exclusively for company—it is still likely to
contain the best furniture in the house; and though that "best" is not
too fine for every-day use, yet in a large family an informal, wet-
weather room of this kind is almost indispensable.
PAINTED WALL-PANEL AND DOOR,
CHÂTEAU OF
CHANTILLY. LOUIS XV.
(EXAMPLE OF CHINOISERIE
DECORATION.)
PLATE XL.
No matter how elaborately the rest of the house is furnished, the
appointments of the morning-room should be plain, comfortable,

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

  • 1.
    Visit https://testbankmall.com todownload the full version and explore more testbank or solutions manual Test Bank for Java Software Solutions 7th Edition (International Edition). John Lewis / William Loftus _____ Click the link below to download _____ https://testbankmall.com/product/test-bank-for-java- software-solutions-7th-edition-international-edition-john- lewis-william-loftus/ Explore and download more testbank or solutions manual at testbankmall.com
  • 2.
    Here are somerecommended products that we believe you will be interested in. You can click the link to download. 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/ Test Bank for Java Software Solutions, 9th Edition John Lewis https://testbankmall.com/product/test-bank-for-java-software- solutions-9th-edition-john-lewis/
  • 3.
    Solution Manual forJava Software Solutions 9th by Lewis https://testbankmall.com/product/solution-manual-for-java-software- solutions-9th-by-lewis/ Test Bank for Java Foundations, 3/E 3rd Edition John Lewis, Peter DePasquale, Joe Chase https://testbankmall.com/product/test-bank-for-java- foundations-3-e-3rd-edition-john-lewis-peter-depasquale-joe-chase/ Solution Manual for Java Foundations, 3/E – John Lewis, Peter DePasquale &amp; Joe Chase https://testbankmall.com/product/solution-manual-for-java- foundations-3-e-john-lewis-peter-depasquale-joe-chase/ Solution Manual for Java Foundations, 3/E 3rd Edition John Lewis, Peter DePasquale, Joe Chase https://testbankmall.com/product/solution-manual-for-java- foundations-3-e-3rd-edition-john-lewis-peter-depasquale-joe-chase/ Test Bank for Java Foundations: Introduction to Program Design and Data Structures, 4th Edition, John Lewis Peter DePasquale Joe Chase https://testbankmall.com/product/test-bank-for-java-foundations- introduction-to-program-design-and-data-structures-4th-edition-john- lewis-peter-depasquale-joe-chase/
  • 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.
    17 Copyright © 2012Pearson Education, Inc. 16) Correct all the syntax errors in the following program. Public Class Program A problem program ( Public static voided main[Strings( ) args] { system.out.println('This program'); * oh, my... * system.out.println('has several syntax errors'); * lots of errors * } ) Answer: public class Program // A problem program { public static void main(String[ ] args) { System.out.println("This program"); /* oh, my... */ System.out.println("has several syntax errors"); /* lots of errors */ } } 17) Name five of the fundamental terms which encompass object-oriented programming. Answer: There are seven terms to choose from: object, attribute, method, class, encapsulation, inheritance, and polymorphism. 18) Write a Java program that will display the following three lines when it is run: * * * * * * * * * Answer: public class Stars { public static void main(String[ ] args) { System.out.println(" *"); System.out.println(" * * *"); System.out.println("* * * * *"); } }
  • 21.
    Exploring the Varietyof Random Documents with Different Content
  • 22.
    too often temptedby mere prettiness of detail to forget the general effect of his composition. In a staircase, where only the general effect is seized, prettiness does not count, and the effect produced should be strong, clear and telling. For the same reason, a stair-carpet, if used, should be of one color, without pattern. Masses of plain color are one of the chief means of producing effect in any scheme of decoration. When the floor of the hall is of marble or mosaic,—as, if possible, it should be,—the design, like that of the walls, should be clear and decided in outline (see Plate XXX). On the other hand, if the hall is used as an antechamber and carpeted, the carpet should be of one color, matching that on the stairs. In many large houses the stairs are now built of stone or marble, while the floor of the landings is laid in wood, apparently owing to the idea that stone or marble floors are cold. In the tropically-heated American house not even the most sensitive person could be chilled by passing contact with a stone floor; but if it is thought to "look cold," it is better to lay a rug or a strip of carpet on the landing than to permit the proximity of two such different substances as wood and stone. Unless the stairs are of wood, that material should never be used for the rail; nor should wooden stairs be put in a staircase of which the walls are of stone, marble, or scagliola. If the stairs are of wood, it is better to treat the walls with wood or plaster panelling. In simple staircases the best wall-decoration is a wooden dado-moulding nailed on the plaster, the dado thus formed being painted white, and the wall above it in any uniform color. Continuous pattern, such as that on paper or stuff hangings, is specially objectionable on the walls of a staircase, since it disturbs the simplicity of composition best fitted to this part of the house. For the lighting of the hall there should be a lantern like that in the vestibule, but more elaborate in design. This mode of lighting
  • 23.
    harmonizes with thesevere treatment of the walls and indicates at once that the hall is not a living-room, but a thoroughfare.[33] If lights be required on the stairs, they should take the form of fire- gilt bronze sconces, as architectural as possible in design, without any finikin prettiness of detail. (For good examples, see the appliques in Plates V and XXXIV). It is almost impossible to obtain well-designed appliques of this kind in America; but the increasing interest shown in house-decoration will in time doubtless cause a demand for a better type of gas and electric fixtures. Meantime, unless imported sconces can be obtained, the plainest brass fixtures should be chosen in preference to the more elaborate models now to be found here. Where the walls of a hall are hung with pictures, these should be few in number, and decorative in composition and coloring. No subject requiring thought and study is suitable in such a position. The mythological or architectural compositions of the Italian and French schools of the last two centuries, with their superficial graces of color and design, are for this reason well suited to the walls of halls and antechambers. The same may be said of prints. These should not be used in a large high-studded hall; but they look well in a small entranceway, if hung on plain-tinted walls. Here again such architectural compositions as Piranesi's, with their bold contrasts of light and shade, Marc Antonio's classic designs, or some frieze-like procession, such as Mantegna's "Triumph of Julius Caesar," are especially appropriate; whereas the subtle detail of the German Little Masters, the symbolism of Dürer's etchings and the graces of Marillier or Moreau le Jeune would be wasted in a situation where there is small opportunity for more than a passing glance. In most American houses, the warming of hall and stairs is so amply provided for that where there is a hall fireplace it is seldom used. In country houses, where it is sometimes necessary to have special means for heating the hall, the open fireplace is of more service; but
  • 24.
    it is notreally suited to such a situation. The hearth suggests an idea of intimacy and repose that has no place in a thoroughfare like the hall; and, aside from this question of fitness, there is a practical objection to placing an open chimney-piece in a position where it is exposed to continual draughts from the front door and from the rooms giving upon the hall. The best way of heating a hall is by means of a faience stove—not the oblong block composed of shiny white or brown tiles seen in Swiss and German pensions, but one of the fine old stoves of architectural design still used on the Continent for heating the vestibule and dining-room. In Europe, increased attention has of late been given to the design and coloring of these stoves; and if better known here, they would form an important feature in the decoration of our halls. Admirable models may be studied in many old French and German houses and on the borders of Switzerland and Italy; while the museum at Parma contains several fine examples of the rocaille period.
  • 25.
    FRENCH ARMOIRE, LOUISXIV PERIOD. MUSEUM OF DECORATIVE ARTS, PARIS. PLATE XXXIII.
  • 26.
    T X THE DRAWING-ROOM, BOUDOIR,AND MORNING-ROOM he "with-drawing-room" of mediæval England, to which the lady and her maidens retired from the boisterous festivities of the hall, seems at first to have been merely a part of the bedchamber in which the lord and lady slept. In time it came to be screened off from the sleeping-room; then, in the king's palaces, it became a separate room for the use of the queen and her damsels; and so, in due course, reached the nobleman's castle, and established itself as a permanent part of English house-planning. In France the evolution of the salon seems to have proceeded on somewhat different lines. During the middle ages and the early Renaissance period, the more public part of the nobleman's life was enacted in the hall, or grand'salle, while the social and domestic side of existence was transferred to the bedroom. This was soon divided into two rooms, as in England. In France, however, both these rooms contained beds; the inner being the real sleeping-chamber, while in the outer room, which was used not only for administering justice and receiving visits of state, but for informal entertainments and the social side of family life, the bedstead represented the lord's lit de parade, traditionally associated with state ceremonial and feudal privileges.
  • 27.
    SALA DELLA MADDALENA,ROYAL PALACE, GENOA. XVIII CENTURY. (ITALIAN DRAWING-ROOM IN ROCAILLE STYLE.) PLATE XXXIV. The custom of having a state bedroom in which no one slept (chambre de parade, as it was called) was so firmly established that
  • 28.
    even in theengravings of Abraham Bosse, representing French life in the reign of Louis XIII, the fashionable apartments in which card- parties, suppers, and other entertainments are taking place, invariably contain a bed. In large establishments the chambre de parade was never used as a sleeping-chamber except by visitors of distinction; but in small houses the lady slept in the room which served as her boudoir and drawing-room. The Renaissance, it is true, had introduced from Italy the cabinet opening off the lady's chamber, as in the palaces of Urbino and Mantua; but these rooms were at first seen only in kings' palaces, and were, moreover, too small to serve any social purpose. The cabinet of Catherine de' Medici at Blois is a characteristic example. Meanwhile, the gallery had relieved the grand'salle of some of its numerous uses; and these two apartments seem to have satisfied all the requirements of society during the Renaissance in France. In the seventeenth century the introduction of the two-storied Italian saloon produced a state apartment called a salon; and this, towards the beginning of the eighteenth century, was divided into two smaller rooms: one, the salon de compagnie, remaining a part of the gala suite used exclusively for entertaining (see Plate XXXIV), while the other—the salon de famille—became a family apartment like the English drawing-room. The distinction between the salon de compagnie and the salon de famille had by this time also established itself in England, where the state drawing-room retained its Italian name of salone, or saloon, while the living-apartment preserved, in abbreviated form, the mediæval designation of the lady's with-drawing-room. Pains have been taken to trace as clearly as possible the mixed ancestry of the modern drawing-room, in order to show that it is the result of two distinct influences—that of the gala apartment and that of the family sitting-room. This twofold origin has curiously affected
  • 29.
    the development ofthe drawing-room. In houses of average size, where there are but two living-rooms—the master's library, or "den," and the lady's drawing-room,—it is obvious that the latter ought to be used as a salon de famille, or meeting-place for the whole family; and it is usually regarded as such in England, where common sense generally prevails in matters of material comfort and convenience, and where the drawing-room is often furnished with a simplicity which would astonish those who associate the name with white-and- gold walls and uncomfortable furniture. In modern American houses both traditional influences are seen. Sometimes, as in England, the drawing-room is treated as a family apartment, and provided with books, lamps, easy-chairs and writing- tables. In other houses it is still considered sacred to gilding and discomfort, the best room in the house, and the convenience of all its inmates, being sacrificed to a vague feeling that no drawing-room is worthy of the name unless it is uninhabitable. This is an instance of the salon de compagnie having usurped the rightful place of the salon de famille; or rather, if the bourgeois descent of the American house be considered, it may be more truly defined as a remnant of the "best parlor" superstition. Whatever the genealogy of the American drawing-room, it must be owned that it too often fails to fulfil its purpose as a family apartment. It is curious to note the amount of thought and money frequently spent on the one room in the house used by no one, or occupied at most for an hour after a "company" dinner.
  • 30.
    CONSOLE IN THEPETIT TRIANON, VERSAILLES. LATE LOUIS XV STYLE. BUST OF LOUIS XVI, BY PAJOU. PLATE XXXV. To this drawing-room, from which the inmates of the house instinctively flee as soon as their social duties are discharged, many necessities are often sacrificed. The library, or den, where the members of the family sit, may be furnished with shabby odds and ends; but the drawing-room must have its gilt chairs covered with brocade, its vitrines full of modern Saxe, its guipure curtains and velvet carpet. The salon de compagnie is out of place in the average house. Such a room is needed only where the dinners or other entertainments given are so large as to make it impossible to use the ordinary living- rooms of the house. In the grandest houses of Europe the gala-
  • 31.
    rooms are neverthrown open except for general entertainments, or to receive guests of exalted rank, and the spectacle of a dozen people languishing after dinner in the gilded wilderness of a state saloon is practically unknown. The purpose for which the salon de compagnie is used necessitates its being furnished in the same formal manner as other gala apartments. Circulation must not be impeded by a multiplicity of small pieces of furniture holding lamps or other fragile objects, while at least half of the chairs should be so light and easily moved that groups may be formed and broken up at will. The walls should be brilliantly decorated, without needless elaboration of detail, since it is unlikely that the temporary occupants of such a room will have time or inclination to study its treatment closely. The chief requisite is a gay first impression. To produce this, the wall-decoration should be light in color, and the furniture should consist of a few strongly marked pieces, such as handsome cabinets and consoles, bronze or marble statues, and vases and candelabra of imposing proportions. Almost all modern furniture is too weak in design and too finikin in detail to look well in a gala drawing-room.[34] (For examples of drawing-room furniture, see Plates VI, IX, XXXIV, and XXXV.) Beautiful pictures or rare prints produce little effect on the walls of a gala room, just as an accumulation of small objects of art, such as enamels, ivories and miniatures, are wasted upon its tables and cabinets. Such treasures are for rooms in which people spend their days, not for those in which they assemble for an hour's entertainment. But the salon de compagnie, being merely a modified form of the great Italian saloon, is a part of the gala suite, and any detailed discussion of the decorative treatment most suitable to it would result in a repetition of what is said in the chapter on Gala Rooms. The lighting of the company drawing-room—to borrow its French designation—should be evenly diffused, without the separate centres of illumination needful in a family living-room. The proper light is
  • 32.
    that of waxcandles. Nothing has done more to vulgarize interior decoration than the general use of gas and of electricity in the living- rooms of modern houses. Electric light especially, with its harsh white glare, which no expedients have as yet overcome, has taken from our drawing-rooms all air of privacy and distinction. In passageways and offices, electricity is of great service; but were it not that all "modern improvements" are thought equally applicable to every condition of life, it would be difficult to account for the adoption of a mode of lighting which makes the salon look like a railway-station, the dining-room like a restaurant. That such light is not needful in a drawing-room is shown by the fact that electric bulbs are usually covered by shades of some deep color, in order that the glare may be made as inoffensive as possible.
  • 33.
    SALON, PALACE OFFONTAINEBLEAU. PLATE XXXVI. The light in a gala apartment should be neither vivid nor concentrated: the soft, evenly diffused brightness of wax candles is best fitted to bring out those subtle modellings of light and shade to which old furniture and objects of art owe half their expressiveness. The treatment of the salon de compagnie naturally differs from that of the family drawing-room: the latter is essentially a room in which people should be made comfortable. There must be a well-appointed writing-table; the chairs must be conveniently grouped about various tables, each with its lamp;—in short, the furniture should be so disposed that people are not forced to take refuge in their bedrooms for lack of fitting arrangements in the drawing-room.
  • 34.
    The old Frenchcabinet-makers excelled in the designing and making of furniture for the salon de famille. The term "French furniture" suggests to the Anglo-Saxon mind the stiff appointments of the gala room—heavy gilt consoles, straight-backed arm-chairs covered with tapestry, and monumental marble-topped tables. Admirable furniture of this kind was made in France; but in the grand style the Italian cabinet-makers competed successfully with the French; whereas the latter stood alone in the production of the simpler and more comfortable furniture adapted to the family living-room. Among those who have not studied the subject there is a general impression that eighteenth-century furniture, however beautiful in design and execution, was not comfortable in the modern sense. This is owing to the fact that the popular idea of "old furniture" is based on the appointments of gala rooms in palaces: visitors to Versailles or Fontainebleau are more likely to notice the massive gilt consoles and benches in the state saloons than the simple easy-chairs and work- tables of the petits appartements. A visit to the Garde Meuble or to the Musée des Arts Décoratifs of Paris, or the inspection of any collection of French eighteenth-century furniture, will show the versatility and common sense of the old French cabinet-makers. They produced an infinite variety of small meubles, in which beauty of design and workmanship were joined to simplicity and convenience. The old arm-chair, or bergère, is a good example of this combination. The modern upholsterer pads and puffs his seats as though they were to form the furniture of a lunatic's cell; and then, having expanded them to such dimensions that they cannot be moved without effort, perches their dropsical bodies on four little casters. Any one who compares such an arm-chair to the eighteenth-century bergère, with its strong tapering legs, its snugly- fitting back and cushioned seat, must admit that the latter is more convenient and more beautiful (see Plates VIII and XXXVII). The same may be said of the old French tables—from desks, card and work-tables, to the small guéridon just large enough to hold a
  • 35.
    book and candlestick.All these tables were simple and practical in design: even in the Louis XV period, when more variety of outline and ornament was permitted, the strong structural lines were carefully maintained, and it is unusual to see an old table that does not stand firmly on its legs and appear capable of supporting as much weight as its size will permit (see Louis XV writing-table in Plate XLVI). The French tables, cabinets and commodes used in the family apartments were usually of inlaid wood, with little ornamentation save the design of the marquetry—elaborate mounts of chiselled bronze being reserved for the furniture of gala rooms (see Plate X). Old French marquetry was exquisitely delicate in color and design, while Italian inlaying of the same period, though coarser, was admirable in composition. Old Italian furniture of the seventeenth and eighteenth centuries was always either inlaid or carved and painted in gay colors: chiselled mounts are virtually unknown in Italy.
  • 36.
    ROOM IN THEPALACE OF FONTAINEBLEAU. LOUIS XV PANELLING, LOUIS XVI FURNITURE. PLATE XXXVII. The furniture of the eighteenth century in England, while not comparable in design to the best French models, was well made and dignified; and its angularity of outline is not out of place against the somewhat cold and formal background of an Adam room. English marquetry suffered from the poverty of ornament marking the wall-decoration of the period. There was a certain timidity about the decorative compositions of the school of Adam and Sheraton, and in their scanty repertoire the laurel-wreath, the velarium and the cornucopia reappear with tiresome frequency. The use to which the family drawing-room is put should indicate the character of its decoration. Since it is a room in which many hours of the day are spent, and in which people are at leisure, it should contain what is best worth looking at in the way of pictures, prints, and other objects of art; while there should be nothing about its decoration so striking or eccentric as to become tiresome when continually seen. A fanciful style may be pleasing in apartments used only for stated purposes, such as the saloon or gallery; but in a living-room, decoration should be subordinate to the individual, forming merely a harmonious but unobtrusive background (see Plates XXXVI and XXXVII). Such a setting also brings out the full decorative value of all the drawing-room accessories—screens, andirons, appliques, and door and window-fastenings. A study of any old French interior will show how much these details contributed to the general effect of the room. Those who really care for books are seldom content to restrict them to the library, for nothing adds more to the charm of a drawing-room
  • 37.
    than a well-designedbookcase: an expanse of beautiful bindings is as decorative as a fine tapestry. The boudoir is, properly speaking, a part of the bedroom suite, and as such is described in the chapter on the Bedroom. Sometimes, however, a small sitting-room adjoins the family drawing-room, and this, if given up to the mistress of the house, is virtually the boudoir. The modern boudoir is a very different apartment from its eighteenth-century prototype. Though it may preserve the delicate decorations and furniture suggested by its name, such a room is now generally used for the prosaic purpose of interviewing servants, going over accounts and similar occupations. The appointments should therefore comprise a writing-desk, with pigeon-holes, drawers, and cupboards, and a comfortable lounge, or lit de repos, for resting and reading. LIT DE REPOS, EARLY LOUIS XV PERIOD. PLATE XXXVIII.
  • 38.
    The lit derepos, which, except in France, has been replaced by the clumsy upholstered lounge, was one of the most useful pieces of eighteenth-century furniture (see Plate XXXVIII). As its name implies, it is shaped somewhat like a bed, or rather like a cradle that stands on four legs instead of swinging. It is made of carved wood, sometimes upholstered, but often seated with cane (see Plate XXXIX). In the latter case it is fitted with a mattress and with a pillow-like cushion covered with some material in keeping with the hangings of the room. Sometimes the duchesse, or upholstered bergère with removable foot-rest in the shape of a square bench, is preferred to the lit de repos; but the latter is the more elegant and graceful, and it is strange that it should have been discarded in favor of the modern lounge, which is not only ugly, but far less comfortable. LIT DE REPOS, LOUIS XV PERIOD. PLATE XXXIX.
  • 39.
    As the boudoiris generally a small room, it is peculiarly suited to the more delicate styles of painting or stucco ornamentation described in the third chapter. A study of boudoir-decoration in the last century, especially in France, will show the admirable sense of proportion regulating the treatment of these little rooms (see Plate XL). Their adornment was naturally studied with special care by the painters and decorators of an age in which women played so important a part. It is sometimes thought that the eighteenth-century boudoir was always decorated and furnished in a very elaborate manner. This idea originates in the fact, already pointed out, that the rooms usually seen by tourists are those in royal palaces, or in such princely houses as are thrown open to the public on account of their exceptional magnificence. The same type of boudoir is continually reproduced in books on architecture and decoration; and what is really a small private sitting-room for the lady of the house, corresponding with her husband's "den," has thus come to be regarded as one of the luxuries of a great establishment. The prints of Eisen, Marillier, Moreau le Jeune, and other book- illustrators of the eighteenth century, show that the boudoir in the average private house was, in fact, a simple room, gay and graceful in decoration, but as a rule neither rich nor elaborate (see Plate XLI). As it usually adjoined the bedroom, it was decorated in the same manner, and even when its appointments were expensive all appearance of costliness was avoided.[35] The boudoir is the room in which small objects of art—prints, mezzotints and gouaches—show to the best advantage. No detail is wasted, and all manner of delicate effects in wood-carving, marquetry, and other ornamentation, such as would be lost upon the walls and furniture of a larger room, here acquire their full value. One or two well-chosen prints hung on a background of plain color will give more pleasure than a medley of photographs, colored photogravures, and other decorations of the cotillon-favor type. Not
  • 40.
    only do mediocreornaments become tiresome when seen day after day, but the mere crowding of furniture and gimcracks into a small room intended for work and repose will soon be found fatiguing. Many English houses, especially in the country, contain a useful room called the "morning-room," which is well defined by Robert Kerr, in The English Gentleman's House, as "the drawing-room in ordinary." It is, in fact, a kind of undress drawing-room, where the family may gather informally at all hours of the day. The out-of-door life led in England makes it specially necessary to provide a sitting- room which people are not afraid to enter in muddy boots and wet clothes. Even if the drawing-room be not, as Mr. Kerr quaintly puts it, "preserved"—that is, used exclusively for company—it is still likely to contain the best furniture in the house; and though that "best" is not too fine for every-day use, yet in a large family an informal, wet- weather room of this kind is almost indispensable.
  • 41.
    PAINTED WALL-PANEL ANDDOOR, CHÂTEAU OF CHANTILLY. LOUIS XV. (EXAMPLE OF CHINOISERIE DECORATION.) PLATE XL. No matter how elaborately the rest of the house is furnished, the appointments of the morning-room should be plain, comfortable,