CS283-FinalExam Spring23
CS283-FinalExam Spring23
CS283
Web Programming
Final Exam
Faculty Computer Science
Semester Spring 2023
Time Allowed
Total Mark 100
Mark Distribution Question 1 ……… 24 Marks
Question 2 ……… 20 Marks
Question 3 …… 30 Marks
Question 4 …… 26 Marks
No. of Pages (including 10 Pages
cover page)
Material provided
Equipment permitted None
Additional Instructions Answer sheet is needed
No books, paper or electronic devices are permitted to be brought into the examination
room other than those specified above.
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
a. GET.
b. LOAD
c. PUT
d. POST
a. An Absolute URL.
b. A Relative URL.
a. Server.
b. Client.
c. Database server.
d. None of these answers is correct.
Page 1 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
a. 184
b. 17014
c. 17095
d. This code has a syntax error.
6) HTTP request and HTTP response are the main components of__________
_______
a. HTTP protocol
b. Web development standards
c. Cyber Security protocols
d. None of the above
a. True.
b. False.
Page 2 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
10) Given the below Javascript code, the value printed in the “demo” element
is__________________
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
let text1 = "CS Students and Engineering Students";
let text2 = "!";
let text3 = text1.concat(" ",text2);
document.getElementById("demo").innerHTML = text3;
</script>
</body></html>
11) Cookies expire as soon as the user closes his browser or end his session.
a. True
b. False
a. HTML
b. Javascript
c. PHP
d. Cascading Style sheets.
Page 3 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
1. Write an HTML code that exactly displays the form illustrated above. [4 Marks]
2. Write a CSS class that defines an error styling class that display the element text
in red color. Use this class in your HTML code to display the errors. (e.g. “You
Must Enter a valid Name”) and this error must be displayed in red next to the
3. Write a PHP code that receives the above form values and check if they are valid.
Assume that the form uses a POST method. Noting that, a “Name” is valid if it is
not empty; And An email is only valid if it matches the regular email format AND
4. Write a PHP code that inserts the values inserted within this form into the
Database (the database table is called users). You can make any assumptions of
5. Write a PHP code that creates session variables and save the data inserted within
Page 4 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
1. Use a DOM function that changes the source attribute of an image element.
3. Write a CSS code that applies blue font color to all paragraph elements.
5. Write a PHP code that retrieves the value of “favorite_color” from a session
variable.
6. Use HTML to create an unordered list of this item (shirt, pants, shoes, cap).
Javascript function for sorting this array and printing it as a numbered list.
9. Write a JavaScript code that display a message says, “ Thank you for reaching
Page 5 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
1. <html>
2. <body>
3. <h1>Welcome to MSA!</h1>
4. <? php include ‘mainMenu.php' ;?>
5. </body>
6. </html>
<html>
<body>
<table>
<caption>My important data</caption>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>Ahmed</td><td>20</td></tr>
<tr><td>Mohamed</td><td>15</td></tr>
</table>
</body>
<html>
<?php
$myfile = fopen(“myData.txt", "a") or die(“file is not accessible");
?>
Page 6 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
<body>
<div>
<p>Paragraph 1 </p>
<p>Paragraph 2 </p>
<section><p>Paragraph 3</p></section>
</div>
<p>Paragraph 4. </p>
<p>Paragraph 5. </p>
</body>
Page 7 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
<body>
<p id="demo"></p>
<script>
let x = 10; End of Exam Questions
{
let x = 100;
}
document.getElementById("demo").innerHTML = x;
</script>
</body>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").hide(4000);
});
});
</script>
Page 8 of 9
October University for Modern Sciences & Arts Module Code: CS283
Faculty of Web Programming
Final -Spring 2023 Time Allowed: 180 Minutes
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
*{
text-align: center;
color: blue;
}
<p id="demo"></p>
<script>
const points = [500,1000,20,15,9];
points.sort(function(a, b){return a - b});
document.getElementById("demo").innerHTML = points.sort(function(a,
b){return a - b});
</script>
Page 9 of 9