Vous êtes sur la page 1sur 21

Tunisian Republic

Ministry of Higher Education and


Scientific Research
University of Tunis
Tunis Business School

ACADEMIC YEAR: 2021/2022


SESSION: Midterm Schedule Semester 2 session DAY : April 4th, 2022 HOUR : 11:30 AM -12:30 AM

MIDTERM • FINAL EXAM •

Level: ………………………. Group: ……………… / Major: ……….…….… Minor: ……………… / Master : ……………

Candidate’s Full Name: ………………………………………………………….…………..…..


Identity Card Number: ………………………………………………………….…………..….. Grade
Registration number ………………………………………………………….………….…..…..
100
Room : ………………………………………………………….…………..…..………………………

CS220: Web Development

Reminders
● Time: 60 minutes
● Note: There are 19 pages in this exam set. Please check the page numbers before you start to solve
questions.
● This is a closed-book exam. You are not allowed to use your own papers, documents, scripts, etc.,
nor any electronic equipment (notebook computers, calculators, cell phones, etc.)
● Note that only answers in the array (2nd page) will be evaluated.

Do not write anything here

● Choose the correct answer (s) and write the corresponding letter(s) option(s). (You must fill
this array)
1
1 2 3 4 5 6 7 8 9 10
(2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt)
Correct
option(s
)

11 12 13 14 15 16 17 18 19 20
(2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt)
Correct
option(s
)

21 22 23 24 25 26 27 28 29 30
(2pt) (4pt) (2pt) (2pt) (2pt) (2pt) (2pt) (6pt) (2pt) (2pt)
Correct
option(s
)

31 32 33 34 35 36 37 38 39 40
(2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt) (2pt)
Correct
option(s
)

41 42 43 44 45
(2pt) (2pt) (4pt) (2pt) (4pt)
Correct
option(s
)

2
------------------------------------------------------------- HTML Questions ---------------------------------------------

1. _______ attribute is used to specify where to open the linked document.

A target

B coords

C rel

D None of the above

2. What is an element that does not have a closing tag called?

A Tag

B Empty element

C Closed element

3. What will be added by using <td> and </td> tag ?

A rows

B steps

C cell

D columns

4. Where do all items for the same website need to be saved?

A In the same folder

B Where ever is fine

C In different folders

3
5. What does < a href = ”http : // www. google.com” target = ” _ blank ” > Google < /a > do?

A Adds a link to google on the page

B Adds a search engine to the page

C
Nothing

6. Choose the correct HTML element for the largest heading:

A <h1>

B <h6>

C <heading>

D <head>

7. Choose the correct the correct HTML code for inserting an image

A <img src=”image.gif”>

B <img href=”image.gif”>

C <image src=”image.gif”>

D <img > ”image.gif”</img>

8. Choose the correct HTML element to define emphasized text

A i

B italic

C em

9. Default style and color of the unvisited link in any browser is ……….

A Underlined and blue

B Normal and blue

C Underlined and pink

D Underlined and magento

4
10. What is the correct HTML for making a drop-down list?

A <list>

B <select>

C <input type=”dropdown”>

D <input type=”list”>

11. Which default method is used while submitting a form

A Get method

B Post method

C Set method

D Put method

12. Which attribute is not used for the radio type?

A name

B selected

C checked

D value

13. Choose the correct output(s):

<!DOCTYPE html>
<html>
<body>
<h1>Midterm Exam</h1>
<p>This is a paragraph.
Choose the correct answer (s) and write
the corresponding letter(s) option(s). </p>
</body>
</html>

5
A

14. Choose the correct output(s):

<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
}
</style>
<body>

<h2>A basic HTML table</h2>

<table style="width:100%">
<tr>
<td>Company</td>
<td>Contact</td>
<td>Country</td>
</tr>
<tr>
<td>Microsoft</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctez</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>

</body>
</html>

6
A

15. Choose the correct output(s):

<!DOCTYPE html>
<html>
<body>
<ul>
<li>Part1</li>
<ol>
<li>Piano</li>
<li>Mezzoforte</li>
<li>forte</li>
</ol>
<li>Part 2</li>
<ol>
<li>Piano</li>
<li>Mezzoforte</li>
<li>forte</li>
</ol>
</ul>
</body>
</html>

7
A

------------------------------------------------------------- CSS Questions ---------------------------------------------

16. What is the correct HTML for referring to an external style sheet?

A <style src=”mystyle.css”>

B <stylesheet>mystyle.css</stylesheet>

C <link rel=”stylesheet” type=”text/css” href=”mystyle.css”>

17. Choose the correct propriety to set the color of all h1 elements to green

A background-color:green;

B color:green;

C h1:green;

18. Select the correct CSS rule-set to make a text bold.

A font:bold;

8
B style:bold;

C font-weight:bold;

19. Choose the correct option to group selectors

A Separate each selector with a space

B Separate each selector with a gomma

C Separate each selector with a plus sign

20. Choose the correct output(s):

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-align: center;
}
p{
color:white;
font-family: verdana;
font-size: 20px;
background-color:black;
}
</style>
</head>
<body>
<h1>Midterm Exam</h1>
<p>This is a paragraph.</p>
</body>
</html>

9
21. Choose the correct output(s):

<!DOCTYPE html>
<html>
<head>
<style>
p{
border: 1px solid black;
padding-left:20px;
padding-top: 25px;
padding-bottom:22px;
}
</style>
</head>
<body>

<p class="ex1">Web Development Exam .</p>

</body>
</html>

22. Choose the correct values of the border-style property for h1 and Div in order to obtain the following
output:

10
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
border-style: (1);
border-width:5px;
}
div {
border-style: (2);
border-width:5px;
}
</style>
</head>
<body>
<h1>Web Development</h1>
<div>CS220 - Midterm</div>
</body>
</html>

(1) A. dotted solid dashed double


B. dotted dashed solid double
C. double dotted dashed solid

(2) A. dotted solid


B. dotted solid dashed
C. solid dashed dotted

23. Choose the correct CSS rule-set to set a background-image (picture.jpg) for the “body” element

A background-image:"picture.jpg";

B background-image: url("picture.jpg");

C background-image: ref("picture.jpg");

24. Choose the correct CSS rule-sets to obtain the following output:

11
A ul { list-style-type:circle; }
ol { background:blue; }

B ol { list-style-type:square; }
ul { background:blue; }

C ul { list-style-type:square; }
ol { background:blue; }

25. Select the correct CSS rule-sets that change the size of the element with id="par" into 25px, and define
the color and the background of all elements with the class "cal" to white and black, respectively.

A <style>
#par { font-size:25px; }
.cal {background:black;color:white;}
</style>
<body>
<p id="par">Paragraph 1</p>
<p class="cal">Paragraph 2</p>
<p class="cal">Paragraph 3</p>
</body>

B <style>
par { font-size:25px; }
.cal {background:black;color:white;}
</style>
<body>
<p id="par">Paragraph 1</p>
<p class="cal">Paragraph 2</p>
<p class="cal">Paragraph 3</p>
</body>

C <style>
#par { font-size:25px; }

12
cal {background:black;color:white;}
</style>
<body>
<p id="par">Paragraph 1</p>
<p class="cal">Paragraph 2</p>
<p class="cal">Paragraph 3</p>
</body>

26. Choose the correct selector to select all h2 elements inside a div element.

A div +h2

B div h2

C div.h2

27. Choose the correct CSS rule-set to display a table with the following options:

The top border = 10 pixels, the bottom border = 5 pixels, the left border = 15 pixels and
the right border = 2 pixel.

A border-width:15px 2px 10px 5px;

B border-width:15px 2px 5px 10px;

C border-width:10px 2px 5px 15px;

28. For each question, choose the option “True” or “False”

1. The <span> element can be used to style a part of a text. A. True


B. False

2. The <div> element can be used to style blocks of content A. True


B. False

3. The padding property declares the margin between an HTML element A. True
and the elements around it. B. False

29. Choose the correct “display” value to obtain the following output

13
<!DOCTYPE html>
<html>
<head>
<style>
h3{
display: …………………………………;
}
</style>
</head>
<body>
<h3>HTML</h3>
<h3>CSS</h3>
<h3>JavaScript</h3>
</ul>
</body>
</html>

A display:block;

B display:none;

C display:inline;
30. Choose the correct output

<!DOCTYPE html>
<html>
<head>
<style>
body {counter-reset: count1;}
h1{counter-reset: count2;}
h1::before { counter-increment: count1;
content: "Chapter " counter(count1) ". ";}
h2::before {counter-increment: count2;
content: counter(count1) "." counter(count2) " ";}
</style>
</head>
<body>
<h1>HTML</h1>
<h2>Introduction</h2>
<h2>Basic Concepts</h2>
<h2>Tutorial</h2>
<h1>CSS</h1>
<h2>Introduction</h2>
<h2>Basic Concepts</h2>
<h2>Tutorial</h2>
</body>
</html>

14
A

------------------------------------------------------------- JAVA Script Questions ---------------------------------------------

31. What is JavaScript?

15
A JavaScript is a scripting language used to make the website interactive

B JavaScript is an assembly language used to make the website interactive

C JavaScript is a compiled language used to make the website interactive

D None of the mentioned

32. Which of the following methods is used to access HTML elements using Javascript?

A GetElementbyId()

B GetElementsbyClassName()

C GetElementsbyTag()

D Both A and B

E Both A and B and C

33. Which of the following is the correct output for the following JavaScript code:

Var x=5,y=1
var obj ={ x:10}
with(obj)
{
alert(y)
}

A 1

B Error

C 10

D 5

34. When interpreter encounters an empty statements, what it will do:

16
A Shows a warning

B Prompts to complete the statement

C Throws an error

D Ignores the statements

35. In the JavaScript, which one of the following is not considered as an error:

A Syntax error

B Missing of semicolons

C Division by zero

D Missing of Bracket

36. Which of the following functions of the String object returns the character in the string starting at the

specified position via the specified number of characters?

A slice()

B split()

C substr()

D search()

37. Suppose we have a text "human" that we want to convert into string without using the "new" operator.

Which is the correct way from the following to do so:

A toString(

B String(human)

C String newvariable="human"

D Both human.toString() and String(human)

38. Which of the following is the correct output for the following JavaScript code:

17
<p id="demo"></p>
<script>
var js = 10;
js *= 5;
document.getElementById("demo").innerHTML = js;
</script>

A 10

B 50

C Error

D 5

39. Which of the following is the correct output for the following JavaScript code:

function test() {

document.write(a);

document.write(foo());

var a = 1;

function foo() {

return 2; }

test();

A 1
2

B undefined
2

C undefined
undefined

D 2
2

40. Up to how many functions can be written inside a single HMTL SCRIPT element:

18
A None

B None or one

C Exactly one

D There is no upper limit

41. HTML5 event attribute ……………….. fires on a mouse click on the element.

A Onchange

B Onclick

C Onfocus

D Onreset

42. Choose the correct event in order to obtain the following output:

<!DOCTYPE html>
<html>
<head>
<script>
function validateForm() {
let x =
document.forms["myForm"]["fname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
</script>
</head>
<body>

Name: <input type="text" name="fname">

<input type="submit" value="Submit"


(1) =" validateForm()">

</body>
</html>

19
A Onchange

B Onclick

C Onfocus

D Onsubmit

43. Choose the correct answer in order to obtain the following output:

<!DOCTYPE html>
<html>
<body>
<p>Please input a number between 1 and 10:</p>
<input id="numb">

<button type="button"
(1) ="myFunction()">Submit</button>

<p id="demo"></p>
<script>
function myFunction() {
let x = document.getElementById("numb").value;
let text;
// If x is Not a Number or less than one or greater
than 10
if (isNaN(x) || x < 1 || x > 10) {
text = "Input not valid";
} else {
text = "Input OK";
}
document. (2) .innerHTML = text;
}
</script>

</body>
</html>

(1) A. Onclick
B. Onfocus
C. Onsubmit

(2) A. getElementsByTagName("demo")
B. getElementById("demo")
C. getElementsByClassName("demo")

44. Choose the correct answer in order to change the text color of the <p> element to "red"

20
<p id="demo"></p>
<script>
document.getElementById("demo"). (1) = "red";
</script>

A .textcolor

B .color

C .style.color

D .background-color

E .element.innerHTML

45. Which event allows you when you enter the input field, a function is triggered which transforms the

input text to uppercase.

<!DOCTYPE html>
<html>
<body>
<h2>JavaScript HTML Events</h2>
Enter your name: <input type="text" id="fname"
(1) ="upperCase()">

<script>
function upperCase() {
const x = document.getElementById("fname");
x. (2) = x.value.toUpperCase();
}
</script>

</body>
</html>

(1) A. Onclick
B. Oninput
C. Onchange

(2) A. value
B. element
C. style

21

Vous aimerez peut-être aussi