Name:     ID: 
 
Email: 

AP Computer Science Ch 7-8

True/False
Indicate whether the statement is true or false.
 

 1. 

When printing the value of a double variable, the methods print and println always display all of the decimal digits.
 

 2. 

A format string is a combination of literal string information and formatting information.
 

 3. 

In a printf statement, a format specifier in the format string and the corresponding expression must match in position and type.
 

 4. 

In a table, a data value is right-justified when its display begins in the leftmost column of its field.
 

 5. 

The String class’s format method takes the same arguments as the printf method.
 

 6. 

All of the early hypertext systems ran on separate standalone machines.
 

 7. 

HTML tags usually occur in pairs.
 

 8. 

An HTML <P> tag must have a corresponding </P> tag.
 

 9. 

Links or anchors can appear within any HTML element.
 

 10. 

Inline images increase a document’s size and slow its transfer across the Internet.
 

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 11. 

Which of the following terms is not associated with handling repeating sets of input?
a.
count-controlled
c.
query-controlled
b.
input-controlled
d.
sentinel-controlled
 

 12. 

Format specifier codes begin with the ____ character.
a.
%
c.
$
b.
#
d.
&
 

 13. 

The ____ format type code in a format specifier would denote a decimal integer value.
a.
d
c.
f
b.
e
d.
i
 

 14. 

The ____ format flag is used for left justification.
a.
+
c.
*
b.
%l
d.
-
 

 15. 

Which of the following represents the proper syntax for a try-catch statement?
a.
try{
   <statements that might throw exceptions>
}catch{
   <code to recover from an exception if it's thrown>
}
b.
try{
   <statements that might throw exceptions>
}(Exception e){
   <code to recover from an exception if it's thrown>
}
c.
try{
   <statements that might throw exceptions>
}catch(Exception e){
   <code to recover from an exception if it's thrown>
}
d.
try{
   <statements that might throw exceptions>
   <code to recover from an exception if it's thrown>

}
 

 16. 

The default layout of a JFrame is a ____.
a.
GridLayout
c.
FlowLayout
b.
BorderLayout
d.
No layout manager
 

 17. 

The JTextField class’s ____ method can be used to set a text field to be read-only.
a.
setEditable
c.
setReadOnly
b.
readOnly
d.
editable
 

 18. 

A markup tag in HTML is surrounded by the ____ symbols.
a.
< ... >
c.
{ ... }
b.
[ ... ]
d.
( ... )
 

 19. 

The ____ HTML tag designates a paragraph of text.
a.
PAR
c.
PARAGRAPH
b.
P
d.
BR
 

 20. 

The ____ HTML tag designates a line break.
a.
BREAK
c.
P
b.
LINE
d.
BR
 

 21. 

There are ____ types of lists that can be displayed in an HTML page.
a.
2
c.
4
b.
3
d.
5
 

 22. 

The HTML markup tag for a link is ____.
a.
<LINK>
c.
<ANCHOR>
b.
<A>
d.
<L>
 

 23. 

Assuming that the current document displayed in a browser is “page1.html”, the relative path name to a page named “page2.html” that is in the directory immediately above the current directory would be ____.
a.
/page2.html
c.
../page2.html
b.
./page2.html
d.
.../page2.html
 

 24. 

When specifying colors in an HTML document, the string ____ indicates black, a total absence of any color, whereas ____ represents white, a total saturation of all colors.
a.
“#FFFFFF”; “#000000”
c.
“#000000”; “#FFFFFF”
b.
“#999999”; “#000000”
d.
“#000000”; “#999999”
 

 25. 

The JApplet method ____ can be used to locate and return the URL of the applet’s Web server.
a.
getServer()
c.
getURL()
b.
getDocumentBase()
d.
getHost()
 



 
         Start Over