Office Use Only Monash University Semester One 2001 Faculty Of Information Technology EXAM CODES: COT2030/CSE2030 TITLE OF PAPER: Input Output Technology EXAM DURATION: PAPER 1 120 minutes writing time READING TIME: 10 minutes THIS PAPER IS FOR STUDENTS STUDYING AT:( tick where applicable) Berwick Clayton Malaysia Distance Education Learning Caulfield Gippsland Peninsula Enhancement Studies (specify) Open Other Candidates are reminded that they should have no material on their desks unless its use has been specifically permitted by the following instructions. AUTHORISED MATERIALS CALCULATORS OPEN BOOK YES NO YES NO Answers for section A must be indicated on the question pages. The answers to section B must be in the space provided in the examination booklet. Use the blank pages if necessary. Answer ALL questions in sections A and B. This exam is worth 60 marks. Section A is worth 10 marks and section B is worth 50 marks. Candidates must complete this section if required to answer in this paper STUDENT ID __ __ __ __ __ __ __ __ DESK NUMBER__ __ __ __ SURNAME ...........................................................................SIGNATURE.............................................. OTHER NAMES (in full) .................................................................................................................................. Section A multiple choice 10 questions, 1 minute each, 10 minutes. 1 of 11 Question 1. Client side scripts are used to (a) Create cookies (b) Validate user inputs entered on HTML forms (c) Open a new browser window to display an alternate web page (d) All of the above Question 2. Which of the following statement is NOT true about event handlers in JavaScript. a) They can be included with the input tags. b) Can be associated with end of file processing for a database application. c) They can be included with the form tag. d) Are generally used to call functions when triggered. Question 3. In HTML, character entries are always preceded by an a) ! b) * c) & d) # Question 4. Which of the following is NOT TRUE with regard to Active Server Pages (ASP) a) ASP’s are Microsoft specific technology b) An ASP is a text file with an .asp extension c) Scripts with ASP’s can be created using Vbscript and JScript d) ASP files can be displayed from a folder on the users workstation using a file URL Question 5. HTTP environment variables are present in a) The UNIX/CGI environment b) The NT/ASP environment c) Both (a) and (b) d) Any operating system environment Question 6. The HTML statement <OL TYPE=”a” START=5> would start a list with a) 5 b) a c) e d) 1 Question 7. Which of the following is NOT part of the ASP object model a) Response b) Request c) FileSystemObject d) Session Question 8. Which property do you reference to retrieve the contents of a TEMPORARY cookie a) Session.cookie b) Document.cookie c) Response.cookie d) Request.cookie Question 9. Which of the following are available to all web pages in an application a) Form parameters 2 of 11 b) Cookie values c) HTML parameters d) All of the above Question 10. Which of the following is NOT performed when creating a Visual Basic CGI program a) Add the ADO reference library to the project to enable database access b) Create a hyperlink or form ACTION attribute to reference the CGI program c) Copy the cgi.bas standard module file to the folder created to store the cgi program source code d) Call the perl script env.pl to create the environment variables from the form variables. Section B short answer, write your answers in the space provided. Question 1 (a) Is the postcode numbering system hierarchical or faceted? Justify your answer. __________________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________ (2marks) (b) Discuss 3 types of error checks that may be used to validate data input. Give examples in your answer __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________ (3marks) c) What kind of processing (client side or server side) is used to process 3 of 11 Java applets_________________________________________________________________ Active server pages____________________________________________________ Javascript programs____________________________________________________ CGI programs________________________________________________________ (2marks) Question 2 (a) Draw the output of the following HTML file indicating any text or item that has special meaning when viewed with a browser. Do not draw images but indicate where they should be. <HTML> <HEAD> <TITLE> Traders Product Guide</TITLE> </HEAD> <BODY> <TABLE ALIGN=CENTER WIDTH="100%"> <TR> <TD><IMG SRC="clearlogo.jpg" WIDTH=170 HEIGHT=100></TD> <TD><BIG><B>Product Guide</BIG></B></TD> <TD><UL> <LI><A HREF="#ItemID1">Hiking Shorts</A> <LI><A HREF="#ItemID2">Fleece Pullover</A> <LI>Shoes <LI>Parkas <LI>Sleeping Bags </UL></TD> </TR> </TABLE> <P><TABLE WIDTH="100%" ALIGN=CENTER BORDER=5 CELLSPACING=3 CELLPADDING=5> <TR> <TH WIDTH="10%">Item ID</TH> <TH WIDTH="40%" ALIGN=LEFT>Item Description</TH> <TH WIDTH="50%">Picture</TH> </TR> <TR> <TD ALIGN=CENTER VALIGN=TOP><A NAME="ItemID1">1</A></TD> <TD VALIGN=TOP>Women's Hiking Shorts</TD> <TD><IMG SRC="shorts.jpg" WIDTH=290 HEIGHT=220></TD> </TR> <TR> <TD ALIGN=CENTER VALIGN=TOP><A NAME="ItemID2">2</A></TD> <TD VALIGN=TOP>Women's Fleece Pullover</TD> <TD><IMG SRC="fleece.jpg" WIDTH=290 HEIGHT=220></TD> </TR> </TABLE> </P> </BODY> </HTML> __________________________________________________________________________ __________________________________________________________________ 4 of 11 __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(4marks) (b) A WWW database application for a UNIX based server has to be converted to an NT based server. Describe the steps necessary to convert the application. Assume that the same data is to be captured from the user and the same data is stored on the server. __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________ (6 marks) Question 3. (a) What is the Global.asa file and how is it used? 5 of 11 __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(3marks) (b) What are the server limitations of CGI processing? __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(2marks) (c) A common condition in WWW users is ‘cognitive overload’ ie. The process of getting to where they are is more complex than the actual content of the page they are browsing. Discuss 3 page design criteria which help to alleviate this. __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(3marks) Question 4. Write a section of javascript OR vbscript code that outputs your name 5 times but each time the font size is increased by 2. 6 of 11 __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(5marks) Question 5 a) What is the difference between using cookies and session variables? __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(2marks) b) What is the function of the following section of code? The line numbers are for reference only. 1. <%@ Language=VBScript%> 2. <%Option Explicit%> 3. <%Response.buffer=true%> 4. <HTML> 5. <HEAD> 6. <TITLE>Conversion Results</TITLE> 7. </HEAD> 8. <BODY> 9. <H1>Feet Conversion</H1> 10. <% 11. Dim intInches, sngFeet 12. Const conConvFactor = 12 13. intInches = CInt(Request.Form("txtInches")) 14. sngFeet = round((intInches / conConvFactor),1) 15. Response.Write("There are " & sngFeet & " feet in " & intInches & " inches.") 16. Session.Abandon 17. %> 18. </BODY> 19. </HTML> __________________________________________________________________ __________________________________________________________________ 7 of 11 __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(4marks) Question 6. (a) Explain what the following code is doing in general. Assume that (i) this code is called from another HTML form used for data input and (ii) the file clsform.cls is a user created class library file which has the following properties: strMode, colFormElements, strServerConnectionString, objConn, objRS and the following methods: CreateDict, Open_Recordset, Mode, Search, Run_SQL. The line numbers are for reference only. Note that some code is missing; see part (b). 1. <%@Language=JScript %> 2. <% Response.Buffer = true %> 3. <!-- #include file="clsForm.cls" --> 4. <html> 5. <head> 6. <title>This is a test question</title> 7. <% 8. function FormValidation() { 9. var blnOK, strSQL; 10. blnOK = (Request.Form("First_Name") == "") || (Request.Form("Last_Name") == "") || (Request.Form("e_mail") == ""); 11. if (blnOK) { 12. Response.Write("<CENTER><H1>Error Information</H1>"); 13. Response.Write("<H3>You must enter all the information that has *'s!</H3><BR>"); 14. Response.Write("Click the Back button on your browser to fix your errors.</CENTER>"); 15. Response.End; 16. } 17. } 18. var objForm,strEval,strErr; 19. FormValidation(); 20. objForm = new clsForm(); 21. if (Request.Form("Mode") == "New") { 22. strErr = objForm.Run_SQL(strSQL); 23. if (strErr != "") { 24. Response.Write("<CENTER><H1>Error Information</H1>"); 25. Response.Write(strErr & "</CENTER>"); 26. Response.End; 27. } 28. } 29. else { 30. if (Request.Form("Mode") == "Update") { 31. strSQL = "UPDATE STUDENTS" + 32. " SET FIRST_NAME = " + 8 of 11 33. "'" + Request.Form("FIRST_NAME") + "'," + 34. "LAST_NAME = " + 35. "'" + Request.Form("LAST_NAME") + "'," + 36. "HOME_PHONE = " + 37. "'" + Request.Form("HOME_PHONE") + "'," + 38. "WORK_PHONE = " + 39. "'" + Request.Form("WORK_PHONE") + "'," + 40. "E_MAIL = " + 41. "'" + Request.Form("E_MAIL") + "'" + 42. " WHERE STUDENT_ID = " + 43. Request.Form("STUDENT_ID"); 44. strErr = objForm.Run_SQL(strSQL); 45. if (strErr != "") { 46. Response.Write("<CENTER><H1>Error Information</H1>"); 47. Response.Write(strErr & "</CENTER>"); 48. Response.End; 49. } 50. } 51. else { 52. strSQL = "DELETE FROM STUDENTS" + 53. " WHERE STUDENT_ID = " + 54. Request.Form("STUDENT_ID"); 55. strErr = objForm.Run_SQL(strSQL); 56. if (strErr != "") { 57. Response.Write("<CENTER><H1>Error Information</H1>"); 58. Response.Write(strErr & "</CENTER>"); 59. Response.End; 60. } 61. } 62. } 63. %> 64. </head> 65. <body> 66. <center><h1>This is a test response Response</h1></center> 67. <center> 68. <p>Thank you for using the test form!<p> 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. <% if (Request.Form("Mode") != "Delete") { %> <p>The information you entered: <br> <ul> <li>First name: <%=Request.Form("First_Name")%></li> <li>Last name: <%=Request.Form("Last_Name")%></li> <li>Home phone: <%=Request.Form("Home_Phone")%></li> <li>Work phone: <%=Request.Form("Work_Phone")%></li> <li>E-Mail: <%=Request.Form("e_mail")%></li> </ul> <% } %> </center> <p> <center>Back to <a href="default.html">MAIN</a>.</center> </body> </html> 9 of 11 __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(8marks) (b) Code is missing for some of the functionality described. What should that code be? _________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ ___________________________________________________________(5marks) 10 of 11 11 of 11