CSCI 4230.1
Internet Application Development
Summer 2001
Final ExaminationName: _________________________________
Time allowed: one hour and 30 minutes.
Open: text book, lecture notes, every file I posted in my Web page, your project assignments, CNet's and WebReview's CSS references.
Answer all questions. Plan your time well.
Turn in both questions and answer sheets. Put the question paper on top for stapling. Be sure to write your name in every answer paper.
Academic honesty policy will be strictly enforced. Cheating will result in a failing grade (D or below) and a permanent academic record.
Total score: 100%.
(1) (a) (10%) Consider the following Javascript code. What will be displayed when it is interpreted by a browser:
<script>
function A (x, y) {
this.x = x;
this.y = y;
}new A(0,0);
A.prototype.x = 20;
A.prototype.z = 30;var a1 = new A(1,2);
var a2 = new A(3,4);
a1.z = 5;
a2.x = 10;document.write(a1.x + " " + a1.y + " " + a1.z + "<br>\n");
document.write(a2.x + " " + a2.y + " " + a2.z + "<br>\n");
</script>(b) (15%) Consider the following HTML file with a missing part (the selector emph):
<html>
<head>
<style>
<!-- Add the definition of the selector emph here. -->
</style>
</head>
<body>
<div class="emph">CSCI 4230 Internet Application Development
</div>
<br>
CSCI 4230 is a course offered by the division of Computing and Mathematics of
the University of Houston - Clear Lake.
</body>
</html>It is displayed in IE as:
![]()
Study the display very carefully (especially the border) and give an appropriate definition of the selector emph for generating the display as close as possible. Note that "CSCI 4230 Internet Application Development" has a background color of #ccccff and a font of Arial.
(c) (25%) Write a HTML/Javascript program to create the following page initially.
![]()
The users may type in text into the text lines, for example, "Kwok-Bun Yue", "Michael Jordan", "Canada" and "United States." When the button "Swap #1" is clicked, the first pair of text is swapped, for example:
![]()
When the button "Swap #2" is clicked, the second pair of text is swapped, for example:
![]()
(2) (50%) Write an ASP program updateForm.asp that can be used as a part of an application to allow user to modify values of a record. The program reads the table t2q2(SSNum, LName, FName, Major) with the DSN "temp". An example of an instance of the table t2q2:
SSNum LName FName Major 123456789 Yue Bun Computer Science 200000000 Davari Sadegh Computer Science 300000000 Perkins Sharon Computer Information Systems The program takes one HTTP parameter, SSNum, and uses it to search the table.
For example, if the following URL is used against the above instance of t2q2:
http://.../updateForm.asp?SSNum=999999999
the following page will be displayed:
![]()
This is because the SSNum 999999999 does not exist in the above instance of t2q2.
On the other hand, if the following URL is used:
http://.../updateForm.asp?SSNum=123456789
the following will be displayed:
![]()
This is because "Bun Yue" has the SSNum of 123456789 in the above table instance. The user may then change the input fields. For example:
![]()
Note that the user has changed the last name "Yue" to "Clinton", the first name "Bun" to "Bill" and the major "Computer Science" to "Political Science" in this example. If the user clicks the "Update Record!" button, the program submits the form to the program Update.asp using the get method with four parameters: SSNum, LName, FName and Major. Continuing the example, the submitted URL is:
http://.../update.asp?SSNum=123456789&lname=Clinton&fname=Bill&major=Political+Science
The program update.asp may then use the values to update the table. Note that you don't need to write update.asp. You only need to write updateForm.asp and your display should be as close to the above as possible. You must use the same HTTP parameter names.