Top Banner

of 15

Web Technologies 0108

Feb 10, 2018

Download

Documents

Tracey Jones
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 7/22/2019 Web Technologies 0108

    1/15

    Suggested Answers with Examiner's Feedback

    Question Paper

    Web Technologies (MC338) : January 2008

    Section A : Basic Concepts (30 Marks)

    This section consists of questions with serial number

    1 - 30.

    Answer all questions.

    Each question carries one mark.

    Maximum time for answering Section A is 30

    Minutes.

    1. Which of the following options is correct with regard to HTML?

    (a) It is a modelling language

    (b) It is a DTP language

    (c) It is a partial programming language

    (d) It is used to structure documents

    (e) It is a scripting language.

  • 7/22/2019 Web Technologies 0108

    2/15

    Suggested Answers with Examiner's Feedback

    5. What would be the colours of the RGB where the hexadecimal values are #FF0000, #00FF00 and #0000FF

    respectively?

    (a) Blue, Green, Red

    (b) Green, Blue, Red

    (c) Green, Red, Blue

    (d) Red, Blue, Green

    (e) Red, Green, Blue.

  • 7/22/2019 Web Technologies 0108

    3/15

    Suggested Answers with Examiner's Feedback

    JavaScript

    var a=80

    var b=(a==80 ? "pass" :"fail");

    document.write(b )

    What will be the output of the above script?

    (a) pass

    (b) fail

    (c) null

    (d) 80

    (e) Error at line 6.

  • 7/22/2019 Web Technologies 0108

    4/15

    Suggested Answers with Examiner's Feedback

    (a) 0

    (b) 1

    (c) 2.083

    (d) 3

    (e) 25%12.

  • 7/22/2019 Web Technologies 0108

    5/15

    Suggested Answers with Examiner's Feedback

    (b) blue

    (c) black

    (d) red

    (e) White.

  • 7/22/2019 Web Technologies 0108

    6/15

    Suggested Answers with Examiner's Feedback

    27. In JSP, a Canvas object provides access to a Graphics object via one of its method called:

    (a) getCanvas()

    (b) getGraphics ()

    (c) paint()

    (d) getPaint()

    (e) accessGraphics ().

  • 7/22/2019 Web Technologies 0108

    7/15

    Suggested Answers with Examiner's Feedback

    the HTML code which generates the web page. The form will enable the user to select a course

    from the Course list BIT, MSC, PGDipFT and PGDipPT. The topics list contains HTML,JavaScript, PERL and ASP.

    ( 8 marks)

    b. Consider the following XML DTD for a book catalogue.

    ]>

    If this is a valid DTD, explain what each line defines. If not, explain what is wrong. ( 2 marks)

    4. a. Explain each of the following XML terms and provide an example XML statement for each of

    them.

    i. Attribute

    ii. Empty Elements

    iii. Root

    iv. XML Declaration

    v. Comments. ( 5 marks)

  • 7/22/2019 Web Technologies 0108

    8/15

    Suggested Answers with Examiner's Feedback

    ABCDEF

    Panja Gutta

    Hyd West

    500082

    West

    India

    09122222222

    09112345678

    NimalJayakody

    09123456789

    ( 5 marks)

    5. a. Describe the similarities and differences between client side scripting and server side scripting

    with respect to browser dependence, database access, response time, authentication, security and

    script execution along with the advantages and disadvantages. ( 7 marks)

  • 7/22/2019 Web Technologies 0108

    9/15

    Suggested Answers with Examiner's Feedback

    Suggested Answers

    Web Technologies (MC338) : January 2008

    Section A : Basic Concepts

    Answer Reason

    1. D All the other options are wrong and incorrect for the question asked. < TO

    2. E All the other options are wrong and incorrect for the question asked. < TO

    3. E Server error 403 means insufficient permission. < TO

    4. A All the other options are correct for the question asked. < TO

    5. E The values are hexadecimal equivalent for Red, Green, Blue. < TO

    6. C According to the specifications of and they are used to define the contents inline or

    block level.

    < TO

    7. D As the remaining all the options are correct and valid for JavaScript. < TO

    8. A Because of the comment nothing will be printed. < TO

    9. E According to the definitions of browser objects, all the statements are true. < TO

    10. A Because the outcome of the ternary operator. < TO

    11. D Because book[1] prints 2 and book[10] prints 10 < TO

    12. A Because cookies are not programs. < TO

    13.B 125/5 is 25 and 25%12 is 1(Remainder) < TO

    14. B All the other options are wrong and incorrect for the question asked. < TO

    15. C All the other options are wrong and incorrect for the question asked. < TO

    16. B Promt( ) is used to get input text from the user. < TO

    17. A All the other options are wrong and incorrect for the question asked. < TO

    18. D All the other options are wrong and incorrect for the question asked. < TO

    19. B Because for applying styles to text of a paragraph P is used in CSS. And hence the text is printed in

    Blue color.

    < TO

    20. E According to the CSS syntax for text alignment.< TO

    21. B Event handlers in JavaScript can t be associated with end of file processing for a database application. < TO

    22. A In JSP setLayout() method is used to specify a container's layout. The remaining all the options are

    incorrect.

    < TO

    23. B Component. setBounds ()isused to set the position and size of a component in JSP. < TO

    24. C According to the semantic of the readLine() method, it returns null when it reaches the end of a file in

    JSP.

    < TO

    Page 9

  • 7/22/2019 Web Technologies 0108

    10/15

    Suggested Answers with Examiner's Feedback

    25. D In JSP Vector class is used implement a growable array of objects. < TO

    26. E According to the definition of the wrapper class. < TO

    27. C According to the definition of the paint() method, The remaining all the options are wrong. < TO

    28. B According to the definition of the Date() method of ASP, The remaining all the options are wrong. < TO

    29. D According to the definition of the FormatDateTime() method of ASP, The remaining all the optionsare wrong.

    < TO

    30. A In ASP, IsNumeric() function returns a Boolean value that indicates whether a specified expression

    can be evaluated as a number.

    < TO

    Section B : Problems

    1. a. Cursor position in javascript

    Find Cursor Position

    function show_coords(event )

    {

    x=event.clientX ;

    y=event.clientY ;

    alert("X coords: " + x + ", Ycoords: " + y);

    }

    Click in the document. An alert box will alert the x and y coordinates of the cursor.

    b. html>

    Note: This example won't work because ASP 3.0 is not installed on our server.

    NOTE: Because the content strings are changed randomly in the text file, and this page has only four contentstrings to choose from, sometimes the page will display the same content strings twice in a row.

    < TOP

    Page 10

  • 7/22/2019 Web Technologies 0108

    11/15

    Suggested Answers with Examiner's Feedback

    2. a. You can use the errorPage attribute of the page directive to have uncaught runtime exceptions automatically

    forwarded to an error processing page. For example:

    redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request

    processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive:

    the Throwable object describing the exception may be accessed within the error page via the exception

    implicit object.

    Note: You must always use a relative URL as the value for the errorPage attribute

    b. Simple Object Access Protocol is a communication protocol used for communication between applicationsby sending messages via Internet. SOAP is platform and language independent and is based on XML.

    A SOAP message is an ordinary XML document containing the following elements:

    A required Envelope element that identifies the XML document as a SOAP message

    An optional Header element that contains header information

    A required Body element that contains call and response information

    An optional Fault element that provides information about errors that occurred while processing the

    message

    All the elements above are declared in the default namespace for the SOAP envelope:

    http://www.w3.org/2001/12/soap-envelope

    and the default namespace for SOAP encoding and data types is:

    http://www.w3.org/2001/12/soap-encoding

    Syntax Rules

    Here are some important syntax rules:

    A SOAP message MUST be encoded using XML

    A SOAP message MUST use the SOAP Envelope namespace

    A SOAP message MUST use the SOAP Encoding namespace

    A SOAP message must NOT contain a DTD reference

    A SOAP message must NOT contain XML Processing Instructions

    Skeleton SOAP Message

    ...

    ...

    ...

    < TOP

    3.

    Web Technologies exam - MC333 Jan-2008

    < TOP

    Page 11

  • 7/22/2019 Web Technologies 0108

    12/15

    Suggested Answers with Examiner's Feedback

    Login Name:

    Password :

    Course :

    BITPG Diploma

    MSC


    Topics to Cover:

    HTML

    JavaScript

    PERL

    Security

    Protocols

    Method of Payment:

    cash

    MasterCard

    Visa

    Cheque


    Preferred time slots:

    08:00-11:00 on Fridays

    12:00-15:00 on Fridays

    17:00-20:00 on Fridays

    10:00-13:00 on Saturdays

    b. It is valid:

    Line 1 gives the name of the document type catalogue.

    Line 2 defines that a catalogue consists of one or more books.

    Line 3 says that a book consists of its authors, title, publisher and year.

    Lines 4, 5, 6 & 7 say that each of these is of string type.

    4. i. It is possible to attach additional information to elements in the form of attributes. Attributes have a nameand a value.

    2581247

    ii. Elements that have no content are knows as empty elements. Usually, they are enclosed in the document for

    the value of their attributes.

    iii. At the root of the document there must be one and only one element. In other words, all the elements in the

    document must be the children of a single element.

    < TOP

    Page 12

  • 7/22/2019 Web Technologies 0108

    13/15

    Suggested Answers with Examiner's Feedback

    Kamal

    2456789

    iv. The XML declaration is the first line of the document. The declaration identifies the document as an XMLdocument.

    v. Comments are used for notes.

    b.

    5. Similarities:

    Both are dynamic.

    Can be used to enhance the functionality of the web page like user interaction

    Differences

    Client side scripting Server side scripting

    Bowser Browser dependant Browser independant

    Database Cannot access database Can access database

    Response Depends on the client machine

    speed

    Depends on the server and network speed

    Authentication Authentication cannot be done Authentication can be done

    Security Security problems are less

    dangerous

    Security problems are dangerous

    Script Downloaded, interpreted and

    executed by the client browser

    User can view the code

    Run on the server and output is displayed

    on the client browser User only can view

    the rendered HTML page

    Advantage Validation is instantaneous and

    catches any erroneous data

    before it goes anywhere.

    Browser independent.

    Disadvantage Browser dependent, therefore

    generated results also browserdependent. If the browser

    disabled or not supported, datavalidation not occur at all

    The data has to be send back and forth

    between the browser and server thereforetake time

    b.

    Function Description

    Asc Converts the first letter in a string to ANSI code

    CBool Converts an expression to a variant of subtype Boolean

    CByte Converts an expression to a variant of subtype Byte

    CCur Converts an expression to a variant of subtype Currency

    < TOP

    Page 13

  • 7/22/2019 Web Technologies 0108

    14/15

    Suggested Answers with Examiner's Feedback

    CDate Converts a valid date and time expression to the variant of subtype Date

    CDbl Converts an expression to a variant of subtype Double

    Chr Converts the specified ANSI code to a character

    CInt Converts an expression to a variant of subtype Integer

    CLng Converts an expression to a variant of subtype Long

    CSng Converts an expression to a variant of subtype Single

    CStr Converts an expression to a variant of subtype String

    Hex Returns the hexadecimal value of a specified number

    Oct Returns the octal value of a specified number

    Section C: Applied Theory

    6. Benefits of Using CSS

    Separation of Style and Structure

    Consistency in Style

    Condensed Code

    ease of maintenance

    Flexible Design increase accessibility

    Easier Modification

    Allows additional features, e.g. dynamic capabilities

    Recommended standard - assures compatibility with present & future designs

    Reduce use of non-standard tags

    One CSS multiple Web pages

    Offers much more detailed attributes

    Faster download time

    Reasons for Using CSS

    1. Build from the ground up to replace traditional Web design methods

    2. Faster download times

    3. Shorter development time

    4. Greater control over the typography in a Web page

    5. It's easy to write

    6. Improvements in accessibility

    7. Print designs as well as Web page designs

    8. Better control over the placement of elements in Web page

    9. The design of Web pages is separated from the content

    10. Better search engine rankings

    Drawbacks of Using CSS

    Browsers slow to adopt (a shrinking issue) Tools slow to adopt (a shrinking issue)

    One more thing to learn and apply

    < TOP

    7. a. The jsp:plugin element instructs the server to build a tag appropriate for applets that use the plug-in. The

    simplest way to use jsp:plugin is to supply four attributes: type, code, width, and height.

    The jsp:plugin element has a number of other optional attributes. Most, but not all, parallel attributes of the

    APPLET element. Here is a full list.

    < TOP

    Page 14

  • 7/22/2019 Web Technologies 0108

    15/15

    Suggested Answers with Examiner's Feedback

    type

    For applets, this attribute should have a value of applet. However, the Java Plug-In also permits you to

    embed JavaBeans elements in Web pages. Use a value of bean in such a case.

    code

    This attribute is used identically to the CODE attribute of APPLET, specifying the top-level applet class

    file that extends Applet or JApplet . Just remember that the name code must be lower case with

    jsp:plugin (since it follows XML syntax), whereas with APPLET, case did not matter (since HTML

    attribute names are never case sensitive).

    width

    This attribute is used identically to the WIDTH attribute of APPLET, specifying the width in pixels to

    be reserved for the applet. Just remember that you must enclose the value in single or double quotes.

    height

    This attribute is used identically to the HEIGHT attribute of APPLET, specifying the height in pixels to

    be reserved for the applet. Just remember that you must enclose the value in single or double quotes.

    b. The jsp:fallback element provides alternative text to browsers that do not support OBJECT or EMBED. You

    use this element in almost the same way as you would use alternative text placed within an APPLET element.

    Error: this example requires Java.

    < TOP OF THE DOCUMENT >

    Page 15