0% found this document useful (0 votes)
18 views

19CSCI04I Internet Programming (202-2023) - Send

Uploaded by

elrevenger20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

19CSCI04I Internet Programming (202-2023) - Send

Uploaded by

elrevenger20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

19CSCI04I

Final Examination,
2022-2023
Informatics and Computer Science
Module Title Internet Programming

Module Leader Dr. Mohamed Mead Semester


Two
Equipment allowed
“None”

Instructions to students:

- The exam paper is 6 pages long.

- Answer all questions.

- The allocation of marks is shown in brackets by the questions.

- The total mark of the exam is 100 marks.

This examination is 2 hours long.


Answer all Questions

Q1 Answer the following questions:

a) Choose the correct Answer [10 marks; 1 mark for each]


i. When does JavaScript code appear inline within an HTML file?
A) Between the 'script' tag B) Outside the 'script' tag
C) Between or Outside the 'script' tag D) None of the mentioned
ii. Connecting websites to backend servers, processing the data and controlling
the behaviour of higher layers, all these things are done by
A) HTML language B) CSS scripts
C) Java Scripts D) Server side PHP scripts
iii. The server side scripts is
A) Visible to the end user B) Invisible to the end user
C) Defined to user D) None
iv. URL is ___________
A) web address B) source code C) user’s address D) an attribute
v. You can update a row using SQL in a database with which of the following?
A) update B) CREATE C) INSERT D) modify
vi. The SQL WHERE clause limits the column data that are returned
A) True. B) False.
vii.The SQL statement “SELECT * FROM Authors WHERE LastName LIKE '_D%'”
locates
A) rows of all the authors whose last name ends with the letter D.
B) rows of all the authors whose last name start with any character followed by the
letter D.
C) rows of all the authors. D) None of the Above.
viii. Which one of the following function is used to destroy a session?
a) start_session() b) session_destroy() c) session_begin() d) unset ()
ix. jQuery is a -
A) JavaScript method B) JavaScript library
C) JSON library D) PHP method
x. Which jQuery method is used to set one or more style properties to the
selected element?
A) The html() method B) The style() method C) The css() method.
D) All of the above

Page 1 of 6
b) Represent the following XML to its corresponding JSON [9 marks]

<employees>
<employee>
<firstName>John</firstName>
<lastName>Doe</lastName>
</employee>
<employee>
<firstName>Anna</firstName>
<lastName>Smith</lastName>
</employee>
<employee>
<firstName>Peter</firstName>
<lastName>Jones</lastName>
</employee>
</employees>

c) For the following HTML, could you tell what does javascript do. [6 marks]

<html>
<body>
<ul>
<li>Yellow</li>
<li>Green</li>
<li>Blue</li>
<li>Orange</li>
</ul>
<script>
var list = document.getElementsByTagName("li");
document.writeln("<h1>The unordered list
consists of: " + list.length + " elements</p>");

for(var i = 0; i<list.length;i++)
{
list[i].style.backgroundColor = list[i].innerHTML;
}
</script>
</body>
</html>

[Q1 Total: 25 marks]

Page 2 of 6
Q2 Create two pages,
a) The first page, send.php, that has a form with the following controls: three text
box to collect the user name, password, and email.
b) You should check that the user entered a value in the user name, password and
email text fields.
c) The second page, recieve.php, receives this data and checks whether user
name exists in the database or not. If it exists then show statement “user is
existing”, otherwise insert this data in user table.
d) The database name is “users” and database username is “root” and password is
empty.
e) The table name in the database is “user” and its fields are “Uname”, “Upass”
and “Email”.
[Q2 Total: 25 marks]

Page 3 of 6
Q 3 Use the XML code listed here to do the following:
<?xml version="1.0" encoding="UTF-8"?>
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
<name>Ola Nordmann</name>
<address>Langgt 23</address>
<city>4000 Stavanger</city>
<country>Norway</country>
</shipto>
<item>
<title>Empire Burlesque</title>
<note>Special Edition</note>
<quantity>1</quantity>
<price>10.90</price>
</item>
<item>
<title>Hide your heart</title>
<quantity>1</quantity>
<price>9.90</price>
</item>
</shiporder>

a) Write an XSD file (shiporder.xsd) representing this XML.


[18 marks]
b) Write the piece of code to retrieve from this XML all title name.
[7 marks]
[Q3 Total: 25 marks]

Page 4 of 6
Q4 Answer the following Questions
a) Give a comparison between GET and POST methods in the form element
[6 marks]
b) Give a comparison between Cookies and Session [6 marks]
c) Give a comparison between Traditional web applications vs. Ajax
applications [7 marks]
d) Explain the function preg_match and mention its parameters [6 marks]

[Q4 Total: 25 marks]

Page 5 of 6
Page 1 of 1

You might also like