Chapter 8

EX 8-1
1.)A hypertext is a structure consisting of nodes and the link between them. Each node is a document or chunk of text. During the late 1960s, the technology for realizing Bush’s dream became available, so Nelson coined the term hypertext to refer to Bush’s machine.
2.)Hypermedia is like hypertext but add more things inside, GUIs, Images, Sound, Animation, and Application.
3.)The address on the page for World Wide Web.
EX 8-2
1.)The HTML stand for hypertext markup language.
2.)The HTML text can indicate the format of textual elements or links to other nodes.
3.)<HTML> <HEAD> <TITLE>the title goes here</TITLE> </HEAD> <BODY> the text for the document goes here </BODY> </HTML>
4.)The HTML is a comment for the creator to reviews.
EX 8-3
1.) The HTML programmer need to use forced line break because a web page author or designer wants to display several lines of text without words wrap.
2.)We are preformatted next in an HTML document when we want the browser to display text, with line breaks, extra spaces, and tabs.
EX 8-4
1.)If you forget to close the markup tag for italics on a piece of text everything after the first quote will be italics.
2.)The purposes of the escape sequence in HTML is to let browser to display these characters rather than interpret them.
EX 8-5
1.)The three types of HTML are: Unordered(bulleted) lists-a bulleted list. Numbered(ordered) lists-can be nested within other lists to any depth, but more than three deep can be difficult to read. Definition(association) lists-display terms and their associated definition.
2.)
EX 8-6
1.)
2.)An absolute path name because it sepcifies the exact or absolute position of the file in the computer’s directory structure.
3.)We can use absolute or relative path names to specify the location of a target document.
4.) 
EX 8-7
1.)Inline images increase a document’s size and slow its transfer across the Internet. External images which are not display until the user clicks on a link.
2.)<IMG src=”ImageLocation”>
3.)<IMG SCR=”mypicture.gif”HEIGHT=200 WIDTH=200>
4.)<A href=”mypicture.gif”>Sample picture</A> <A href=”mypicture.gif”><IMG src=”mythumbnail.gif”></A>
EX 8-9
1.)An applet is a Java application that runs in a Web page, an HTML document that contains an applet markup tag. Example:<APPLET CODE=”byte code file name” WIDTH=width HEIGHT=height></APPLET>
2.)Applications that use a specialized view class for the main window, the conversion to an applet is surprisingly simple. First, replace the name JFrame with the name JApplet at the begining of the class definition. Second, replace the class’s constructor by the method init: public void init(){ }
3.)An applet cannot access files on the ensure security on the user’s machine.
4.)The images must reside on the Web server from which the applet’s byte code was sent. The JApplet method getDocumentBase() locates and returns the URLof the applet’s Web server. The JApplet method getImage expects this URL and the filename of an image as parameters. The method downloads the image from the Web server and returns an object of the class Image. This object can be converted to an ImageIcon object for further processing by using the ImageIcon(anImage) constructor.

Published in: on January 23, 2008 at 6:10 pm  Leave a Comment  

Chapter 7 Exercise

EX 7-2
1.)The structure of a query-controlled loop that processes repeated sets of inputs is the String variable doInAgain. This variable controls how many times the loop repeats, initially, the variable equals “y”. As soon as the user enters a string other than “y” or “Y”, the program terminates.
2.)Since the input of a lower case letter and a capital case letter count two different input, the toLowerCase() method avoid the problem of entering a same letter with wrong and get the wrong result. Therefore, the toLowerCase facilitate the program by indiscriminate between the lower case and the capital case letter.

EX 7-3
1.)The role the menu plays is to display a list of options, after this, the user can select the one they needs.
2.)The menu-driven programs prompts fro additional inputs related to that option and performs the needed computations, after which it displays the menu again.

EX 7-4
1-a.)%11s
b.)%12s
c.)%-15
d.)System.out.printf(”%6o”, i)
e.)System.out.printf(%10.2f)
2-a.)10,000.50
b.)45 632
c.)34.54

EX 7-5
1.)The program will halt and give an error message.
2.)The programmer embeds the call to an input method in a try-catch statement, as its name implies, this statement consists of two parts. The statement within the try clause are executed until one of them throws an exception. If that happens, an exception object is created and sent immediately to the catch clause. The code within the catch clause is then executed. Alternatively, if no statement throws an exception within the try clause, the catch clause is skipped.

Published in: on January 8, 2008 at 1:49 pm  Leave a Comment  
Follow

Get every new post delivered to your Inbox.