You are on page 1of 2

St.

Anthony’s College
San Jose, Antique

ENGINEERING AND TECHNOLOGY DEPARTMENT

Laboratory Work in CpEIN 102 – Event Driven Programming

Laboratory Activity No. 12 Week No. 14

Prepared by: Albert B. Villanueva

Checked by: Engr. Daisy Rose Virgini M. Plameras

I. Course Learning Outcomes: At the end of the course, students shall be able to:
1. Apply their knowledge in creating a high-level block-structured programming
language.
2. Demonstrate the knowledge in object-oriented, event-driven programming and
systems development.
3. Demonstrate ability to develop programming applications to manipulate databases
(including query, display, edit, update functions).

Intended Learning Outcomes: At the end of the lesson, student shall be able to create a
web page using Basic Animation.

II. Laboratory Name/Title: Basic Animation.

References/Materials:

References:
Copernicus P. Pepito. Introduction to JavaScript Programming (Series 1 – Simple Web
Development)
Albert Villanueva (June 17, 2020). Powerpoint Presentation in Event Driven Programming

Materials:
Computer Unit
Sublime Text Application

III. Procedure:
1. Design and develop a JavaScript program that will return the hour, minute and second upon
the arrival of the surfer in our webpage. This time, it will be formatted in a 12-hour format.

IV. Post Laboratory Activity


Perform the following exercise:
2. Design and develop a JavaScript program that will determine how many days we still have
before Christmas day.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script>
function getDays() {
var targetDay = new Date("Dec 25, 2021 00:00:00").getTime();
var now = new Date().getTime();
var distance = targetDay - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var out = "There's still " + days + " days 'till Christmas!";
alert(out);
};
</script>
</head>

<body>

<button onClick="getDays()">How many days till Christmas?</button>

</body>
</html>

You might also like