Q3 Computer 10 Week 1
Q3 Computer 10 Week 1
3RD Quarter
Lesson 5:
PERFORMING MENSURATION AND CALCULATION
Learning Competencies
Select measuring tools appropriate to the object to
be measured based on job requirements
Quarter 3 Select appropriate measuring instruments according
WEEK 1 to job requirements
Use alternative measuring tools without sacrificing
cost and quality of work
Introduction
Learning Objectives/Outcomes:
Lesson Proper:
What is JavaScript?
COMPUTER 10 Page 1
When JavaScript was created, it initially had another name:
“LiveScript”. But Java was very popular at that time, so it was decided
that positioning a new language as a “younger brother” of Java would
help.
Note: JavaScript is case sensitive. One wrong casing in the codes won’t
make the whole program work that is why it is a good practice to double
check the characters, text and symbols that you use.
/* example of a
multi-line comment
in JavaScript */
COMPUTER 10 Page 2
General Structure
<html>
Statement is placed between
<head>
<script> and </script>
<title> javascript sample code
</title>
</head>
<body> document.write() displays
whatever string is entered
<script type = “text/javascript”>
inside the parenthesis
document.write (“HELLO between the open and close
WORLD!”); quotation marks “ “.
</script>
</body>
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Hello");
document.write("World");
</script>
</body> You will see that there is no space
</html> between the HelloWorld output.
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Hello“ +
“<br>”); • You will observe that a + symbol is
added
document.write("World");
• The html tag <br> is used and is
</script> placed between the “ “.
</body> • The + symbol combines the <br> tag
with the text Hello which is telling
</html> the browser to display the output of
the document.write (“World”) on the
next line.
COMPUTER 10 Page 3
JAVASCRIPT VARIABLES
Example:
var x = 5
<script type>
OUTPUT:
var x = 5 5
document.write (x)
</script>
<script type>
OUTPUT:
var x = 5
5x
document.write (x):
document.write (“x”);
</script>
COMPUTER 10 Page 4
NAME: __________________________________
SECTION: _______________________________
EXERCISES/ACTIVITIES:
Activity 1:
Enumerate and explain in your own words the following.
Activity 2:
Predict the output of the following. Write your answer in the
box.
A.
<script type>
var x = 21 OUTPUT:
document.write (“x”)
</script>
B.
<script type>
OUTPUT:
var x = 5
document.write (x):
document.write (x);
</script>
COMPUTER 10 Page 5
It’s now time to
evaluate your
learning.
NAME: ______________________________________
SECTION: _____________________________
Multiple Choice.
COMPUTER 10 Page 6