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

Semi-Detailed Lesson Plan in Variables and Data Types

I. Objectives

At the end of the 40-minutes lesson, the students are should be able to:

1. Discuss the Variables and the Different Data Types


2. Value and familiarize with Different Data Types.
3. Enumerate and Identify the Different Data Types.

II. Subject Matter


Topic: Variables and Data Types
Materials: Hand-outs, Whiteboard marker
Laptop, Projector, Pictures
References: https://ocw.mit.edu/ , scribd.com
Value: Importance of the Variables and Data Types
III. Procedure
A. Preliminary Activities
a.Greeting
b.Prayer
c. Checking of Attendance
d. Setting Classroom Rules
e. Review
 What was our topic yesterday?

f. Drill
We will play a game, I will show some pictures, if the picture is a number say Integer, if letter only say
Character, if word String, if fraction Floating Point.

g. Unlocking Difficulties
Read-write – capable of reading existing data and accepting alterations or further input.
Identifier – a sequence of characters used to identify or refer to a program or an element, such as a
variable or a set of data, within it.

Compilers - a program that converts instructions into a machine-code or lower-level form so that they
can be read and executed by a computer.
B. Development of the Lesson

a. Motivation
The teacher will show them a video related to the topic. After watching the video, let the students
share their ideas about Variables and Data types.

b. Presentation

c. Lesson Proper

Variables – A symbol or name that stands for a value. • A variable is a value that can change. •
Variables provide temporary storage for information that will be needed during the lifespan of the
computer program (or application).
Example:
z=x+y

• This is an example of programming expression.


• x, y and z are variables.
• Variables can represent numeric values, characters, character strings, or memory addresses.

Variables store everything in your program.


• The purpose of any useful program is to modify variables.
• In a program every, variable has:
– Name (Identifier)
– Data Type
– Size
– Value

Types of Variable
• Local variables are those that are in scope within a specific part of the program (function, procedure,
method, or subroutine, depending on the programming language employed).
• Global variables are those that are in scope for the duration of the programs execution. They can be
accessed by any part of the program, and are readwrite for all statements that access them.
Data Types – Data type is classification of a particular type of information. Data types are essential to
any computer programming language. Without them, it becomes very difficult to maintain information
within a computer program. Different data types have different sizes in memory depending on the
machine and compilers.

Data Types
• Integer
• Floating-point
• Character
• String
• Boolean

Integer
• A whole number, a number that has no fractional part. • The following are integers:
0 1 -125 144457
• In contrast, the following are not integers:
5.34 -1.0 1.3E4 "string"
• There are often different sizes of integers available.
for example, PCs support short integers, which are 2 bytes, and long integers, which are 4 bytes.

Floating-point
• A number with a decimal point.
• The following are floating-point numbers:
3.0 -111.5
• Floating-point representations are slower and less accurate than fixed-point representations, but they
can handle a larger range of numbers.
• It requires more space.

Character
• In graphics-based applications, the term character is generally reserved for letters, numbers, and
punctuation.
• It only can represent single character. • The following are characters: a A @ $

String
• String is a sequence of character.
• Example:
– Kuala Lumpur
– John White
– Computer

Boolean
• This data type has two possible values only:
– True
– False
• Use this data type for simple flags that track true/false conditions.

d. Generalization

1. Give example of Integer data?


2. Give example of Floating-Point data?
3. Give example of Boolean data?
e. Application
GROUP ACTIVITY: The class will be divided into two groups; each group will give 10 examples of data
types and write it on a manila paper. After writing some examples they will give it to the other group and the
other group will identify if it is Integer, Character, String or Floating Point.
f. Value Integration
Information and important facts is very helpful in dealing with technologies. We must have a veracious
information about certain areas that we might need in the future.

I. Evaluation
Get a one-half sheet of yellow paper and answer the following questions.
1. A symbol or name that stands for a value?
2. Variable that can be accessed by any part of the program?
3. Variable that scopes only in a specific area of the program?
4-8. Give 5 data types.
9-10. Give 2 types of Integer.

II. Assignment
Research and find out anything about Data Base.
Write it on a one whole sheet of yellow paper,

Presented By:
Joshua A. Almuete

You might also like