Archive for January, 2008
{ January 30, 2008 @ 1:45 pm }
·
{ Uncategorized }
{ }
·
{ }
1. Describe the simplest format of an HTML applet tag. Give an example.
— below is the HTML code:
2. How is an application converted to an applet?
— Two steps:
a. Replace the name JFrame with the name JApplet at the beginning of the class definition(extends JApplet).
b. Replace the class’s constructor by the method init:
public void init(){
statement
}
3. What can an application do that an applet cannot do ?
— Applets can’t access files on the user machine. More secure.
APPlets and the HTML documents that use them should be placed in the same directory.
4. Describe the steps required to load an image into an applet.
–a. Locate this applet’s web server and load the image.
b. Convert to an image icon for further processing.
{ January 29, 2008 @ 2:45 pm }
·
{ Uncategorized }
{ }
·
{ }
1. Describe how you create a table using the HTML table tags.
— First specify that HTML code as table. Then make a caption on the top, then comprise column header and informations about each header below.
2. Write an HTML code segment that displays a 3*3 table with cells that are numbered as follows:
1 2 3
4 5 6
7 8 9
{ January 29, 2008 @ 2:30 pm }
·
{ Uncategorized }
{ }
·
{ }
1. What is the difference between an inline image and an external image?
— Inline images are graphical images that are displayed when the user opens a page.
2. Write the simplest version of the format of the markup tag for an inline image.
— The simplest version of the format of the markup tag for an inline image is:
3. Write a markup tag that loads an inline image of the file image.gif, centers the image, and scales its size to 200pixels * 200 pixels.
— 
4. What are two ways of tagging an external image? Give an example of each.
— The two ways are by displaying a text that can be clicked and get you the image. The other one is to display the smaller version of that image and by clicking it, it give you the full version of that image.
Picture

{ January 28, 2008 @ 4:25 pm }
·
{ Uncategorized }
{ }
·
{ }
1. Write the form of the markup tag for links.
— text of link
2. What is an absolute path name? Give an example.
– It specifies the exact or absolute position of the file in the computer’s directory structure.
example: C:\Code\Java.html
3. What is a relative path name? Give an example.
– It specify the location of a target document relative to that of the currently displayed document.
example: /MyCode. html
4. Write the format of a URL to another Web site.
– My e-mail
{ January 28, 2008 @ 4:12 pm }
·
{ Uncategorized }
{ }
·
{ }
1. List three types of HTML lists and describe their characteristics.
— a. Unordered list: list items with bullets
b. Numbered list: list items with numbers
c. Definition list: list items with terms and definition.
2. Write an HTML code segment that uses a list to display the names of your grandparents and your parents. The list should be organized to show the relationships clearly:
–
- Grandparents
- Grandma: Ming Ouyang
- Grandpa: Shuyan Chen
- Parents:
- Mother: Ling Lin
- Father: Limin Chen
{ January 25, 2008 @ 4:42 pm }
·
{ Uncategorized }
{ }
·
{ }
1. What happens if you forget to close the markup tag for italics on a piece of text?
— It will keep doing the italic for the whole thing.
2. What is the purpose of the escape sequences in HTML? Give an example.
— It will display the HTML special characters instead of using them.
{ January 24, 2008 @ 6:41 pm }
·
{ Uncategorized }
{ }
·
{ }
1. When does the HTML programmer need to use forced line breaks?
— The programmer needs to put a
in the end of that line.
2. When do we use preformatted text in an HTML document?
— When we want the code reader to interpret the input from the keyboard.
3. Write an HTML code segment that shows a level 1 heading and a level 2 heading.
—
The first heading
First paragraph
The second heading
Second paragraph
{ January 23, 2008 @ 6:45 pm }
·
{ Uncategorized }
{ }
·
{ }
1. What does HTML stand for?
— It stands for Hypertext markup language.
2. What is the purpose of HTML tags?
–It can indicate the format of texual elements or links to other nodes. It’s to tell the browser how it wants to be displayed.
3. Write an HTML code segment that shows the minimal HTML document structure for a Web page.
—
David Chen’s Page
David is handsome boy.
4. What is an HTML comment? Give an example.
–It is some lines that won’t appear on the screen and will make the code more readable.
{ January 23, 2008 @ 6:29 pm }
·
{ Uncategorized }
{ }
·
{ }
1. describe the basic ideas underlying hypertext.
— A hypertext is a structure consisting of nodes and the likes between them.
2. Wha is the difference between hypertext and hypermedia?
–Hypermedia may show icon or image rather than as highlighted text.
3. What is a URL?
— Uniform resource locators. It’s the address of the website.
{ January 15, 2008 @ 4:34 pm }
·
{ Uncategorized }
{ }
·
{ }
1. Assume that a program is trying to read a double value from the keyboard. The user enters the characters “$12.55″. Explain what happens next.
– The program will halt and give an error message.
2. Explain how a try-catch statement works.
– The try clause execut the statement that may throw exceptions. The clause will run until getting a exception, then the catch clause gets the exception and the statement within the catch clause is executed. If there is no exception, then the catch clause is skipped.
3. Write a code segment that loops until the user has entered a well-formed double value at the keyboard.
– double x;
while (continue.equals(“y”)|| continue.equals(“Y”)){
while (true)
try{
System.out.print(“Enter a well-formed double value: “);
x= reader.nextDouble();
break;
}catch(Exception e){
System.out.println(“Error in number format!”);
reader.nextLine();
}
System.out.println(x);
}
« Previous entries