Note for teachers using this lesson plan
This lesson introduces students to High Level Languages and demonstrates practical BASIC programming for calculations and loop structures. Ensure a computer with a BASIC interpreter (like QBasic) is available for live demonstrations and guided practice. Emphasise the efficiency gained by using loop statements, and guide students to write and test simple programs to calculate rectangle areas, sum integers, and display array elements.
Class: SS 3
Term: First Term
Week: 9
Age: 16 years
Duration: 45 minutes
Subject: Computer Science
Topic: BASIC PROGRAMMING III
Subject Matter: Calculate the area of 10 different rectangles with and without while- end statements: High Level Language (HLL); Definition of HLL; Examples:- BASIC, FORTRAN, ALGOL etc
Specific Objectives
By the end of the lesson, pupils/students should be able to:
Cognitive Domain
- Define High Level Language (HLL).
- List examples of High Level Languages.
- Explain the purpose of the WHILE-END statement in programming.
- Write a BASIC program to calculate the area of multiple rectangles without using a loop.
- Write a BASIC program to calculate the area of multiple rectangles using a WHILE-END loop.
- Write a BASIC program to output the sum of the first 100 integers.
- Write a BASIC program to output the elements of a given array.
Affective Domain
- Appreciate the efficiency and importance of using loop statements in programming.
- Value structured programming for solving repetitive tasks.
Psychomotor Domain
- Demonstrate the use of WHILE-END statements in simple BASIC programs.
- Implement BASIC code to perform calculations and data display.
Reference Materials
The following resources were used in planning this lesson:
- 2025 Revised 9 Years Basic Education Curriculum
- Relevant State Unified Scheme of Work
- Computer Science for Senior Secondary Schools, Book 3
- The HeadTeacher Scheme of work
Instructional Materials
The teacher will teach this lesson with the aid of:
- A computer with a BASIC interpreter (e.g., QBasic)
- Projector or large screen for displaying code
- Whiteboard and markers
- Sample BASIC program codes for demonstration
Rationale for the Lesson
This lesson provides students with practical programming skills using BASIC, focusing on the application of high-level languages and control structures. Understanding loops is fundamental for writing efficient programs that handle repetitive tasks, which is essential for problem-solving in computer science.
Prerequisite/Previous Knowledge
Students should have basic knowledge of computer programming concepts, including variables, data types, input/output statements, and arithmetic operations in BASIC.
Lesson Content/Board Summary
BASIC PROGRAMMING III
High Level Language (HLL)
A High Level Language (HLL) is a programming language that is closer to human language than machine language. It uses English-like statements and mathematical notations, making it easier for programmers to write, read, and understand code compared to low-level languages.
Characteristics of HLLs:
- They are user-friendly and easier to learn.
- They are machine-independent, meaning programs written in an HLL can run on different types of computers with minimal changes.
- They require a compiler or interpreter to translate the code into machine-executable instructions.
- They support complex data structures and operations.
Examples of High Level Languages
- BASIC (Beginner’s All-purpose Symbolic Instruction Code)
- FORTRAN (Formula Translation) – Primarily for scientific and engineering applications.
- ALGOL (Algorithmic Language) – Used mainly for scientific computations.
- C – A powerful general-purpose language.
- PASCAL – Designed for teaching structured programming.
- PL/I (Programming Language One) – A general-purpose language.
- PROLOG (Programming in Logic) – Used for artificial intelligence and computational linguistics.
- COBOL (Common Business-Oriented Language) – Used for business applications.
BASIC Programming for Rectangle Area Calculation
To calculate the area of a rectangle, the formula is Area = Length × Breadth.
Calculating the Area of 10 Different Rectangles without WHILE-END Statements
Without a loop, the code for inputting length, breadth, and calculating the area would have to be written repeatedly for each rectangle. For 10 rectangles, this means writing the same set of instructions 10 times.
Example for one rectangle (repeated 10 times):
PRINT "Enter length for Rectangle 1:" INPUT L1 PRINT "Enter breadth for Rectangle 1:" INPUT B1 AREA1 = L1 * B1 PRINT "Area of Rectangle 1 = "; AREA1 PRINT "Enter length for Rectangle 2:" INPUT L2 PRINT "Enter breadth for Rectangle 2:" INPUT B2 AREA2 = L2 * B2 PRINT "Area of Rectangle 2 = "; AREA2 ' ... and so on for 10 rectangles
Calculating the Area of 10 Different Rectangles with WHILE-END Statements
The WHILE-END (or WHILE-WEND in some BASIC dialects) statement creates a loop that executes a block of code repeatedly as long as a specified condition is true. This makes the program more concise and efficient for repetitive tasks.
Syntax:
WHILE condition
' Code to be executed
' Statement to change the condition (e.g., increment a counter)
WEND
Example program:
CLS ' Clear screen
COUNT = 1 ' Initialize a counter for the rectangles
WHILE COUNT <= 10 ' Loop as long as COUNT is less than or equal to 10
PRINT "--- Rectangle "; COUNT; " ---"
PRINT "Enter length:"
INPUT L
PRINT "Enter breadth:"
INPUT B
AREA = L * B
PRINT "Area = "; AREA
PRINT
COUNT = COUNT + 1 ' Increment the counter
WEND
PRINT "Calculation for 10 rectangles complete."
END
Outputting the Sum of the First 100 Integers
This task involves adding numbers from 1 to 100. A loop is ideal for this. The FOR-NEXT loop is often used for a fixed number of iterations.
Example program:
CLS
SUM = 0 ' Initialize sum to 0
FOR I = 1 TO 100 ' Loop from I = 1 to 100
SUM = SUM + I ' Add current value of I to SUM
NEXT I ' Move to the next value of I
PRINT "The sum of the first 100 integers is: "; SUM
END
Outputting the Value Elements of a Given Array
An array is a collection of elements of the same data type stored under a single variable name. Each element is accessed using an index.
Example program to declare and print elements of an array:
CLS
DIM MyArray(5) ' Declares an array named MyArray with 6 elements (index 0 to 5)
' Or 5 elements (index 1 to 5) depending on BASIC dialect.
' Let's assume 1-based indexing for simplicity here.
' Assign values to the array elements
MyArray(1) = 100
MyArray(2) = 200
MyArray(3) = 300
MyArray(4) = 400
MyArray(5) = 500
PRINT "Elements of MyArray:"
FOR I = 1 TO 5 ' Loop through the array elements
PRINT "Element "; I; ": "; MyArray(I) ' Print each element
NEXT I
END
Teaching Methods/Instructional Techniques
Discussion, Demonstration, Guided Practice, Question and Answer, Explanation, Problem Solving.
Instructional Procedures
Step 1: Introduction
Time: 5 minutes
Teaching Skill: Review/Engage
Teacher’s Activity: The teacher greets the students and reviews previous knowledge on basic programming concepts like variables and input/output statements. The teacher then introduces the topic of High Level Languages and the need for efficient coding for repetitive tasks.
Pupils’ Activity: Students respond to questions about previous lessons and listen attentively to the introduction of the new topic.
Learning Point: Recap of basic programming
Step 2: Introduction to High Level Languages (HLL)
Time: 7 minutes
Teaching Skill: Explanation/Definition
Teacher’s Activity: The teacher defines High Level Languages (HLLs) and explains their characteristics, emphasising their user-friendliness and machine independence. The teacher uses the projector to display the definition.
Pupils’ Activity: Students listen, ask questions for clarification, and understand the definition of HLLs.
Learning Point: Definition of HLL
Step 3: Examples of High Level Languages
Time: 5 minutes
Teaching Skill: Listing/Illustration
Teacher’s Activity: The teacher lists and briefly explains common examples of HLLs such as BASIC, FORTRAN, ALGOL, C, PASCAL, PL/I, PROLOG, and COBOL, highlighting their primary uses where applicable.
Pupils’ Activity: Students identify and recall various examples of High Level Languages.
Learning Point: Examples of HLLs
Step 4: Rectangle Area Calculation without Loops
Time: 6 minutes
Teaching Skill: Demonstration/Problem Solving
Teacher’s Activity: The teacher demonstrates how to write a BASIC program to calculate the area of a single rectangle. The teacher then explains that to calculate for 10 rectangles without a loop, the code would be repeated 10 times, highlighting its inefficiency.
Pupils’ Activity: Students observe the demonstration and understand the concept of repetitive code without loops.
Learning Point: Repetitive code without loops
Step 5: Rectangle Area Calculation with WHILE-END Loop
Time: 8 minutes
Teaching Skill: Demonstration/Guided Practice
Teacher’s Activity: The teacher introduces the WHILE-END loop statement. The teacher then demonstrates how to modify the previous program to calculate the area of 10 different rectangles efficiently using a WHILE-END loop, explaining each part of the loop structure (initialization, condition, increment).
Pupils’ Activity: Students follow the demonstration, ask questions, and practice tracing the loop’s execution.
Learning Point: WHILE-END loop application
Step 6: Outputting Sum of Integers and Array Elements
Time: 5 minutes
Teaching Skill: Demonstration/Application
Teacher’s Activity: The teacher further demonstrates the power of loops by showing BASIC programs to calculate the sum of the first 100 integers and to output elements of a given array, using FOR-NEXT loops.
Pupils’ Activity: Students observe the new applications of loops and understand how they simplify complex tasks.
Learning Point: Loop for sum and arrays
Step 7: Evaluation/Review
Time: 5 minutes
Teaching Skill: Questioning/Assessment
Teacher’s Activity: The teacher evaluates the learning by asking the following questions:
- What is a High Level Language?
- Mention three examples of HLLs.
- Explain the advantage of using a WHILE-END loop.
- Write a simple BASIC code snippet to print numbers from 1 to 5 using a loop.
Pupils’ Activity: Pupils answer orally and in writing.
Learning Point: Understanding HLLs and loops
Step 8: Note-Taking
Time: 4 minutes
Teaching Skill: Guided Writing
Teacher’s Activity: The teacher guides pupils/students to copy the essential Board Summary notes on HLLs, examples, and BASIC programming examples into their notebooks.
Pupils’ Activity: Pupils/students copy the notes carefully into their notebooks.
Learning Point: Recording lesson content
Step 9: Conclusion
Time: 2 minutes
Teaching Skill: Consolidation
Teacher’s Activity: The teacher summarises the key points of the lesson, reiterating the importance of HLLs and loop structures in programming. The teacher encourages students to practice writing simple BASIC programs.
Pupils’ Activity: Students listen and prepare for the next lesson.
Learning Point: Lesson summary and practice encouragement
Continuous Assessment/Further Study
Type: Homework
Instruction: Answer the following questions and write the specified BASIC programs in your notebook.
- Differentiate between a High Level Language and a Low Level Language.
- Write a BASIC program using a WHILE-END loop to calculate and print the squares of numbers from 1 to 15.
- Write a BASIC program to input 5 names into an array and then print each name.
Lesson Keywords
- HLL – High Level Language
- BASIC – Beginner’s All-purpose Symbolic Instruction Code
- FORTRAN – Formula Translation
- ALGOL – Algorithmic Language
- WHILE-END – A loop control statement in BASIC
- Loop – A sequence of instructions that is continually repeated until a certain condition is reached
- Array – A collection of elements of the same data type
Differentiation
For struggling learners: Provide simplified code examples and step-by-step guidance for writing basic programs. Focus on understanding the concept of loops with fewer iterations (e.g., 3 rectangles instead of 10). Offer one-on-one support during practical sessions.
For advanced learners: Challenge them to write programs using other loop types (e.g., FOR-NEXT for the rectangle area calculation) or to implement error handling (e.g., ensuring length and breadth are positive numbers). Encourage them to explore more complex array operations.
Suggested Lesson Videos
For further understanding of BASIC programming and loop structures, search on YouTube for:
- “QBasic WHILE WEND loop tutorial”
- “BASIC programming for beginners loops”
- “High Level Programming Languages explained”
Teacher Guide for Using This Lesson Plan
Before the lesson, ensure that a computer with a BASIC interpreter (such as QBasic) is set up and working, connected to a projector. Prepare sample BASIC code snippets for demonstration, especially for the rectangle area calculation with and without loops, the sum of integers, and array element output. Begin by reviewing fundamental programming concepts to ensure students have a solid foundation. Guide students through the definitions and examples of High Level Languages, allowing time for questions. When demonstrating programming, explain each line of code clearly. Emphasise the practical benefits of using loops for efficiency and conciseness, especially when dealing with repetitive tasks like calculating the area of multiple rectangles. During guided practice, encourage students to try writing simple programs themselves. Allow students to copy the Board Summary notes after the main teaching points have been covered and understood. Check for understanding frequently through questioning and by observing students’ engagement with the practical examples. Provide immediate feedback and support to correct misconceptions. For faster learners, suggest additional programming challenges. For slower learners, offer simplified tasks and more direct assistance.

Community Join the conversation Open discussion +