Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Lesson Plan

(Variable)
I. LESSON OVERVIEW
In this lesson, the students will be introduced to the variable, string, numeric, and array and the
way we can utilize them in various ways.

II. OBJECTIVES
At the end of the discussion, pupils will be able to:
1. Define Variables
2. Differentiate numeric, string, and array variables

III. GUIDE QUESTIONS


- Have you heard the word “variable”?
- What comes into your mind when you hear the word variable?

IV. PREPARATION
A. Reference
- _____________

B. Key Vocabulary
⮚ Variable - is a storage or a placeholder for a certain information that can be manipulated or
changed.
⮚ String - are variables that hold zero or more characters such as letters, numbers, spaces,
commas and many more.
⮚ Numeric - is anything of, relating to, or containing numbers.
⮚ Array - is a special variable, which can hold more than one value at a time.

C. Materials
1. Slide presentation
2. Laptop
3. Projector

V. INTRODUCTION
A. Test the students’ knowledge about variables using the guide questions.

VI. Development of the Lesson


A. Discussion
1. Discuss the definition of variable and give example.
2. Explain and differentiate the difference between string, numeric, and array.
B. Activities
1. Show to the students 2 containers with a certain value inside.
2. Ask them to guess the value of container number 1 and container number 2. With
the following clues:
- If con1 gives data to con2, both strings have the same value.
- If con2 gives data to con1. The number value of con1 is double to the value
of con2.

VII. Wrap-up
A. Use let’s browse back to summarize the lesson.
B. Briefly recall the definition of variable, string, numeric, and array.
Lesson Plan
(Variable)
Lesson Plan
(Variable)

Variable - a symbolic name associated with a value and whose associated value may be changed

String Variables - are variables that hold zero or more characters such as letters, numbers, spaces, commas
and many more.
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as
some kind of variable.
A string is a data type used in programming, such as an integer and floating point unit, but is used to represent
text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers.

numeric-variable name is an arbitrary name that you select, and you and the computer system use to refer to
some location in memory. The value contained in that location may change or vary during execution of a
program.

The values of a numerical variable are numbers. They can be further classified into discrete and continuous
variables. Discrete numerical variable. A variable whose values are whole numbers (counts) is called discrete.
For example, the number of items bought by a customer in a supermarket is discrete.

Numeric is anything of, relating to, or containing numbers. The numbering system consists of ten different
digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. If a value is an alphanumeric, it contains letters and numbers.

An array is a special variable, which can hold more than one value at a time.

If you have a list of items (a list of car names, for example), storing the cars in single variables could look like
this:

var car1 = "Saab";


var car2 = "Volvo";
var car3 = "BMW";

However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars,
but 300?
Lesson Plan
(Variable)

The solution is an array!

An array can hold many values under a single name, and you can access the values by referring to an index
number.

An array is a variable containing multiple values. Any variable may be used as an array. There is no
maximum limit to the size of an array, nor any requirement that member variables be indexed or assigned
contiguously. Arrays are zero-based: the first element is indexed with the number 0.

An array is a collection of a fixed number of values of a single type. For example: if you want to store 100
integers in sequence, you can create an array for it. int data[100]; The size and type of arrays cannot be
changed after its declaration

You might also like