Lesson Notes By Weeks and Term - Senior Secondary 2

Program development III

Term: 3rd Term

Week: 3

Class: Senior Secondary School 2

Age: 16 years

Duration: 40 minutes of 2 periods each

Date:       

Subject:      Computer studies and ICT

Topic:-       Program development III

SPECIFIC OBJECTIVES: At the end of the lesson, pupils should be able to

  1. Define a compiler and describe how it works
  2. Discuss how an interpreter works
  3. Explain program maintenance

INSTRUCTIONAL TECHNIQUES: Identification, explanation, questions and answers, demonstration, videos from source

INSTRUCTIONAL MATERIALS: Videos, loud speaker, pictures, Data Processing for senior Secondary Education by Hiit Plc, WAPB Computer Studies for Senior Secondary II by Adekunle et  al, On-line Materials.

INSTRUCTIONAL PROCEDURES

PERIOD 1-2

PRESENTATION

TEACHER’S ACTIVITY

STUDENT’S ACTIVITY

STEP 1

INTRODUCTION

The teacher reviews the previous lesson on program development

Students pay attention

STEP 2

EXPLANATION

He defines a compiler and describes how it works

 

Students pay attention and participates

STEP 3

DEMONSTRATION

He further discusses how an interpreter works. He also explains what program maintenance is

Students pay attention and participate

STEP 4

NOTE TAKING

The teacher writes a summarized note on the board

The students copy the note in their books

 

NOTE

Compilation and interpretation of program

A compiler translates the entire program (source code/program) written in a high level language into an intermediate form called (object code/program), which can be directly executed by the machine.  On the other hand, an interpreter does not produce an object code but translate the source program line by line directly into machine language.

 

Examples of compiled programs languages are: C, C++, C#, Ada, ALGOL, Java, COBOL, Visual Basic, Lisp, FORTRAN, Pascal

Examples of interpreted languages are: QBASIC, JavaScript, PHP, ASP, APL

 

How a compiler works

The brain of the compiler is the parser. It knows the syntax (rule) of the source language or the grammatical rules that determine how the source statements are written. Whenever the parser needs more of the source program statements to work on, it calls upon the scanner. The scanner reads in the source program statement and breaks it into a sequence of tokens – words, numbers, identifiers, operators etc. It hands them one at a time to the parser whenever the parser calls for the next one.

 

The parser also knows the semantics (meaning) of the source language. The parser’s knowledge of the semantics enables it to call the code generator to produce the object code, which performs the operation specified by the instruction. This continues until the entire program has been read in and translated.

 

How an interpreter works

Just like the compiler, an interpreter also has a parser that controls it. Its scanner does the same job as that of the compiler. However, an interpreter has an executor instead of the code generator.

 

PROGRAM MAINTENANCE

It is the process of updating or amending previously written program for current use

 

 EVALUATION: 1. Explain compiler and describe how it works

  1. Explain interpreter and describe how it works
  2. What is program maintenance?

CLASSWORK: As in evaluation

CONCLUSION: The teacher commends the students positively