Internet Programming and Applications - Exam

UNIVERSITY OF DODOMA

ACADEMIC YEAR 2022/2023


QUESTION ONE

True or False

1. JavaScript can use either single or double quotes around its strings.
(1 Mark)

2. It is not possible to show images on a web page without the <img> tag.
(1 Mark)

3. JavaScript is the same as Java.
(1 Mark)

4. The Bootstrap grid system is based on 9 columns.
(1 Mark)

5. When using class and id in a CSS the priority is given to class.
(1 Mark)

6. In JavaScript, window.prompt() method return true or false value.
(1 Mark)

7. JavaScript is case-sensitive.
(1 Mark)

8. jQuery is a Server scripting library.
(1 Mark)

9. Cards replace panels, thumbnails, and wells used in Bootstrap 3 and are essentially a contained group of content with a border and inner padding.
(1 Mark)

10. A big challenge with responsive design is finding a balance between the content needs for both mobile and desktop.
(1 Mark)


QUESTION TWO

Predict the Output

a.

<script>
  var x = 7;
  var y = 5;
  var z = 14;
  x = y;
  z = z % x;
  alert(y + z);
</script>

b.

<script>
  var a = 1;
  a = a + 1;
  var b = "a is " + a;
  a = 5;
  alert(b);
</script>

c.

<script>
  var a = prompt("enter number", "31");
  var b = a + 5;
  var c = "b is " + b;
  alert(c);
</script>

d.

<script>
  var name = prompt("enter your name", "Albus Percival Wulfric Brian Dumbledore");
  if (name.length < 20)
    alert("Wow, that's quite a mouthful!");
</script>

e.

<script>
  var s = "JavaScript is seldom used to write complete program";
  document.writeln(s.indexOf('w'));
  document.writeln("<br/>");
</script>

QUESTION THREE

Write HTML5 Code

a. Image with caption

b. Footer with copyright

c. Centered header

d. Centered list

e. Horizontal rule and centered list


QUESTION FOUR

jQuery Statements

a. Change background color of #colorDiv to green

b. Change src of image with name myImage to landscape.jpg


QUESTION FIVE

HTML Form and jQuery Table

a. Pet Information Form

b. jQuery Dynamic Table


QUESTION SIX

To-Do List with Alternating Background


**QUESTION SEVEN

Guessing Game


QUESTION EIGHT

E-Commerce Website with Bootstrap