Problems


[Page 479 (continued)]

13.1

What is meant by each of the following?

  • HTML

  • XML

  • XHTML

  • Map

  • Set

  • List

  • Relational Database

  • Helper Method

  • Database Driver

  • Connection

  • SQL

  • ODBC

13.2

What is the hexadecimal color code for a color with a red value of 255, a green value of 255, and a blue value of 51? What is the hexadecimal color code for a color with a red value of 204, a green value of 0, and a blue value of 204? What is the hexadecimal color code for a color with a red value of 255, a green value of 204, and a blue value of 204? Use a hexadecimal color code to specify the background color for a homepage generated by one of the methods in the class WebPageWriter.


[Page 480]
13.3

Using a text editor, write an HTML page that has a table in it. Use a browser to check that it is working. Then add the HTML for the table to the body of a homepage generated with the class WebPageWriter.

13.4

Add a new method like createImagePage in the class WebPageWriter that will create a table where the first row has four columns of pictures. The second row would have the picture file names.

13.5

Add a method to the class WebPageWriter that will print out the file names for all files ending with ".wav" in a passed directory. You can add a link to the sound files name which will play the sound when the user clicks on the link. Just use the link (anchor) tag: <a href="soundFile.wav">soundFile.wav</a>.

13.6

Write a class that will find the most important headline from someplace like cnn.com and use that class to add a headline to the homepage generated by the method writeHomepage in the class WebPageWriter.

13.7

Create a method writeNewsPage in the class WebPageWriter that will create a page of the information you find important from at least three Web sites.

13.8

If you are using Java 5.0 (1.5) or above rewrite the method createStudents in the Student class to use generics with ArrayList and List.

13.9

Modify the PhoneBook class to use a treeMap instead of a HashMap. Does anything change when you execute the method printBook?

13.10

Create a class PictureBook that is like the class PhoneBook except that it maps a person's name to his or her picture.

13.11

Add a method getName(String phoneNumber) to the PhoneBook class. Can you think of a fast way to look up the name when you are given the phone number?

13.12

Create a main method for the class DatabaseManager that prints out the name and age of all the people who are under 30 in the database.

13.13

Create a main method for the class DatabaseManager that prints out the last name, and age of all the people who are under 30 in the database.

13.14

Create a main method for the class DatabaseManager that prints out the first name, last name, and age of all the people who are under 30 in the database who's first name starts with the letter 'T'.

13.15

Create a main method for the class DatabaseManager that prints out the first name, last name, and age of all the people who are over 30 in the database or who's last name is "Guzdial".

13.16

Add a method getListForQuery(String query) to the DatabaseManager class that will return a List of all the columns in the first row returned in the result set for the passed query. You can find out how many columns have been returned by getting a ResultSetMetaData object from the ResultSet object using the method getMetaData() method. You can then ask the ResultSetMetaData object for the number of columns by using the method getColumnCount().


[Page 481]
13.17

Add a method writeHomepageV6 which is like method writeHomepageV5 except that it also shows all the pictures associated with this person on their generated homepage.

13.18

Your father calls you. "My tech-support people are saying that the company Web site is down because the database is broken. What does the database have to do with our company Web site?" You explain to him how databases can be integral to running large Web sites. Explain both (a) how the Web site comes to be authored through the database and (b) how the HTML is actually created.

13.19

You have a new computer that seems to connect to the Internet, but when you try to go to http://www.cnn.com you get a "Server Not Found" error. You call tech support, and they tell you to try to go to http://64.236.24.20. That works. Now both you and the tech know what's wrong with your computer's settings. What isn't working properly, since you can get to a site via the Internet but can't get the domain name www.cnn.com recognized?

13.20

Add something to your HTML homepage generator that will make random, relevant comments about the weather depending on the temperature.

  • If it's going to be less than 32, you want to insert either "Watch out for ice!" or "Is it going to snow?"

  • If it's going to be between 32 and 50, you want to insert either "I can't wait for winter to be over!" or "Come on, Spring!"

  • If it's over 50 but less than 80, you want to insert either "It's getting warmer!" or "Light jacket weather."

  • If it's over 80, you want to insert either "FINALLY! Summer!" or "Time to go swimming!"



Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
ISBN: N/A
EAN: N/A
Year: 2007
Pages: 191

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net