CSC329 · TU past paper
Web Technology 2076 question paper
The complete TU 2076 exam paper for Web Technology (CSC329), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- Q1.10 marksObjects and propertiesHideAnswer
How can you create objects in Javascript? Create a HTML page containing a division with image and its description in paragraph. Write a javascript function to change the value of description in the paragraph during onmouseover and mouseout event on the image.[10]
- Q2.10 marksPositioningHideAnswer
How positioning of HTML elements can be done using CSS? Create a HTML page with a div with some content and two paragraph with some contents having id p1 and p2. Write external CSS for the div tag having fixed position with border style solid and width 2px. the p1 should have relative position. The font type of p1 should be Arial and color should be red. The p2 have absolute position with top 0px and left 200px.[10]
- Q3.10 marksWorking with PHP and MySQLHideAnswer
Create web form for book search catalog. The form should contain a dropdown defining search type, a text box for search keyword, a radio button for download type true or false, now write PHP script to store data from the form into database table and also retrive the results from stored table in a new page.[10]
- Q4.5 marksHTTPHideAnswer
What is HTTP protocol? Define HTTP Request and Response. [5]
HTTP Protocol: Request and Response
HTTP Protocol
HTTP (Hyper Text Transfer Protocol) is the underlying protocol used by the World Wide Web. It defines how messages are formatted and transmitted, and what actions web servers and browsers should take in response to various commands.
Key characteristics of HTTP:
- It is based on the client-server model where the client sends a request and the server sends a response.
- HTTP is implemented over a TCP connection, ensuring reliable data transmission.
- When a user enters a URL in a browser, an HTTP command is sent to the web server directing it to fetch and transmit the requested web page.
Working of HTTP (Request-Response Cycle)
The step-by-step working of HTTP is as follows:
- User enters a web address (URL) in the browser.
- Browser uses DNS to locate the IP address of the server.
- Browser opens a TCP connection to the server.
- Browser sends an HTTP Request over the connection.
- Server sends an HTTP Response over the connection.
- Browser displays the body of the response in the browser window.
HTTP Request
An HTTP Request is a message sent by the client (browser) to the server asking for a specific resource. It typically contains:
Component Description Request Method Type of action: GET, POST, PUT, DELETE, etc. URL The address of the resource being requested HTTP Version Version of HTTP being used (e.g., HTTP/1.1) Headers Additional information such as host, content-type, cookies Body Data sent to the server (mainly used in POST requests) Example of an HTTP Request:
GET /index.html HTTP/1.1 Host: www.example.com Accept: text/html
HTTP Response
An HTTP Response is the message sent by the server back to the client after processing the request. It typically contains:
Component Description Status Line HTTP version and status code (e.g., 200 OK, 404 Not Found) Headers Metadata such as content-type, content-length, date Body The actual content (HTML page, image, data, etc.) Common HTTP Status Codes:
200 OK- Request was successful404 Not Found- Requested resource not found500 Internal Server Error- Server encountered an error
Example of an HTTP Response:
HTTP/1.1 200 OK Content-Type: text/html Content-Length: 1024 <html> <body>Welcome to Example!</body> </html>
Summary: HTTP is the foundation of data communication on the web. The client sends an HTTP Request specifying what resource it needs, and the server replies with an HTTP Response containing the requested resource or an appropriate error message.
- Q5.5 marksEvents and EffectsHideAnswer
How jQuery animate can be used to create custom animation? Write syntax with sample script. [5]
- Q6.5 marksIntroduction to JSONHideAnswer
What is the use of JSON? How can you parse a JSON, illustrate with an example. [5]
- Q7.5 marksIntroduction to XML and its ApplicationHideAnswer
What is XML? Create an XML file containing records of employee having elements of simple and complex types. [5]
- Q8.5 marksXSD AttributesHideAnswer
How XSD of a XML file is created? Illustrate with an example. [5]
- Q9.5 marksVariablesHideAnswer
How can you define variables in PHP? Define any two variable of string types and display their results after concatenation. [5]
- Q10.5 marksMedia QueriesHideAnswer
How web pages can be made responsive using media queries? Illustrate with an example. [5]
- Q11.5 marksHeaderHideAnswer
Create a HTML page with tags header, article and footer. Insert alink containing mail to [email protected] in the footer tag. Set the keywords 'iost', 'csit' using Meta tag in the page. [5]
- Q12.5 marksFramesHideAnswer
Why inline frames are used? Create a HTML page containing iframe within a paragraph. The iframe have source to http://www.tuiost.edu.np and its height and width are 200px and 400px respectively. [5]