Computing
Step into a digital world.....

J277 25: Subprograms, Files and SQL

OCR GCSE COMPUTER SCIENCE · J277 · PAPER 2

Subprograms, files and SQL

Build code from reusable blocks, keep data in files, and search a database.

Paper 2 · Lesson 25

1 / 24
volgende
Slide 1: Slide
newEditorComputer ScienceUpper Secondary (Key Stage 4)GCSE

In deze les zitten 24 slides, met interactieve quizzen en tekstslides.

time-iconLesduur is: 60 min
Dit is niet oké

Introductie

OCR GCSE Computer Science (J277), Paper 2, lesson 25 of 26 (Block D). Students learn to write procedures and functions with parameters, explain the difference between local and global variables and give the benefits of subprograms, then open, read, write and close text files and use SQL (SELECT, FROM, WHERE with AND, OR and LIKE) to search a table of records, in OCR Exam Reference Language and Python. Activities include a do now on lesson 24, picture questions, a drag-and-drop on functions and procedures, a spot-the-mistake task, a sorting question, fill in the blanks and an exam-style question with a model answer. This lesson was created with AI assistance.

Onderdelen in deze les

OCR GCSE COMPUTER SCIENCE · J277 · PAPER 2

Subprograms, files and SQL

Build code from reusable blocks, keep data in files, and search a database.

Paper 2 · Lesson 25

Lesson 25 of the J277 series (Block D, Paper 2, section 2.2.3 Additional programming techniques): the use of subprograms (functions and procedures), basic file handling, and the use of records and SQL to search for data.

Cover photo: Tekton / Unsplash (hologram of an open toolbox: each tool does one job and is used again and again, like a subprogram).

Device-free: show the slide; pupils write the title and date. Image credit: Tekton / Unsplash (cover hologram)

00 · MISSION · BY THE END OF THIS LESSON

By the end of this lesson you can…

01  Write procedures and functions with parameters, and explain local and global variables.

02  Open, read, write and close a text file in ERL and Python.

03  Use SQL SELECT, FROM and WHERE to search a table of records.

Read the three outcomes. J277 section 2.2.3 expects pupils to use subprograms (functions and procedures), basic file handling (open, read, write, close, create a new file) and records with SQL to search for data, in OCR Exam Reference Language (ERL) or a high-level language such as Python.

Device-free: pupils copy the outcomes and tick each one at the end.

02 · CHECK · DO NOW (LESSON 24)

Warm up: strings, arrays and records

1  What does "COMPUTER".length give?

2  What index does the first element of an array have?

3  What does board[1,2] mean?

4  What is a record?

▮ TERMINAL // do_now_answers

1  8  (C O M P U T E R)

2  index 0

3  row 1, column 2

   (both counted from 0)

4  related fields about one thing;

   each field can have its own

   data type

Retrieval from lesson 24. Give 4 minutes, then click to reveal the answers line by line.

1 "COMPUTER".length gives 8: it counts the characters, C O M P U T E R (len("COMPUTER") is 8 in Python 3). 2 The first element of an array is at index 0. 3 board[1,2] is the element in row 1, column 2: the second row and the third column, because both are counted from 0. 4 A record groups related fields about one thing, such as one pupil, and each field can have a different data type.

Today records come back: a database table is a set of records, and SQL searches them.

Device-free: questions on the board; mini whiteboards.

Recap. Lap times are stored in times = [58, 61, 55, 63, 60]. What is times[3]?

A

55

B

63

C

60

D

61

Answer: B, 63. Count from index 0: times[0] is 58, times[1] is 61, times[2] is 55, times[3] is 63 (checked in Python 3).

55 is the third value, the answer if you count from 1. 60 is the last value (times[4]). 61 is times[1].

Photo: Tom Morbey / Unsplash.

Device-free: students hold up A, B, C or D cards. Image credit: Tom Morbey / Unsplash

01 · LEARN · MISSION BRIEFING

Build with blocks

Real programs are not one long list. Today: three tools for bigger programs.

SUBPROGRAMS

Named blocks of code that do one job. Write once, use often.

FILES

Keep data after the program stops: open, read, write, close.

SQL

Ask a database table for just the records you need.

SYSTEM VOICE

System online. Today's mission: build with blocks. Write procedures and functions, pass in parameters, keep variables local, read and write files, and search a database with SQL.

Click play for the system voice briefing. The words are also on the slide.

So far most programs in this course have been one list of instructions from top to bottom. Real programs are thousands of lines long, so programmers split them into subprograms: named blocks that each do one job. Programs also need to keep data after they close (files) and to find data quickly in large tables (databases searched with SQL).

Quick hook: a game has a subprogram to draw the score, saves the high score to a file so it is still there tomorrow, and an online leaderboard is a database searched with SQL.

Device-free: pupils list three separate jobs a game program has to do.

01 · LEARN · PROCEDURES AND FUNCTIONS

A procedure does a job; a function returns a value

▮ TERMINAL // blocks.erl

1  procedure greet(name)

2      print("Hello " + name)

3  endprocedure

4  function area(w, h)

5      return w * h

6  endfunction

7  greet("Zara")

8  a = area(3, 4)

9  print(a)

 

> Hello Zara   > 12

▮ TERMINAL // blocks.py

1  def greet(name):

2      print("Hello " + name)

3

4  def area(w, h):

5      return w * h

6

7  greet("Zara")

8  a = area(3, 4)

9  print(a)

 

> Hello Zara   > 12

Procedure: does a job, hands nothing back.   Function: hands a value back with return.

A subprogram is a named block of code that does one job. It only runs when it is called (lines 7 and 8). There are two kinds.

Left, OCR Exam Reference Language. greet is a PROCEDURE: it does a job (prints a greeting) but does not hand a value back. It starts with procedure and ends with endprocedure. area is a FUNCTION: it works something out and RETURNS it with return, so the result can be stored (a = area(3, 4)) or printed. It ends with endfunction.

Trace (ask for each output first): line 7 calls greet with "Zara", so it prints Hello Zara. Line 8 calls area with 3 and 4; it returns 3 * 4 = 12, which is stored in a. Line 9 prints 12.

Right, Python (click to reveal line by line): both kinds start with def and the body is indented; there is no end keyword. A Python function has a return line; a procedure does not. Checked in Python 3: the output is Hello Zara, then 12, each on its own line.

Misconception: print is not return. A function that prints its answer instead of returning it cannot be used in a = area(3, 4).

Device-free: pupils write a function cube(n) that returns n n n, in ERL and Python.

01 · LEARN · PARAMETERS AND SCOPE

Parameters, arguments, local and global

▮ TERMINAL // bonus.erl

1  global bonus = 5

2  function addBonus(score)

3      total = score + bonus

4      return total

5  endfunction

6  print(addBonus(10))  // 15

▮ TERMINAL // bonus.py

1  bonus = 5

2  def add_bonus(score):

3      total = score + bonus

4      return total

5

6  print(add_bonus(10)) # 15

PARAMETER

score: the name in the brackets of the definition.

ARGUMENT

10: the value passed in when it is called.

LOCAL

total: only exists inside the subprogram.

GLOBAL

bonus: can be used anywhere in the program.

Trace first: line 6 calls addBonus with 10. Inside, score is 10, bonus is 5, so total = 15, which is returned and printed. Output 15 (checked in Python 3 with the right-hand version).

Click to reveal the four terms. A PARAMETER is the variable named in the brackets of the definition (score). An ARGUMENT is the actual value passed in when the subprogram is called (10). A LOCAL variable is created inside a subprogram and only exists while it runs (total): print(total) in the main program would cause an error (Python 3 gives a NameError). A GLOBAL variable is declared in the main program and can be used anywhere.

In OCR ERL a global variable is declared with the keyword global, as in line 1. In Python, a variable made in the main program can be READ inside a function; to CHANGE it inside a function, Python needs the line global bonus inside the function.

Why prefer local variables: a subprogram that only uses its parameters and local variables cannot accidentally change data elsewhere, and the same names can be reused in different subprograms.

Device-free: pupils label a copy of the code with the four terms.

01 · LEARN · WHY USE SUBPROGRAMS?

Write it once, use it everywhere

REUSE

Write the code once and call it as often as you need. Less code to write, fewer chances for mistakes.

EASIER TO TEST

Each subprogram can be tested on its own, with its own test data, before it joins the program.

EASIER TO MAINTAIN

Fix a bug or make a change in one place, and every call uses the new version.

DECOMPOSITION

A big problem is split into small parts. Different programmers can write different subprograms.

These are the benefits OCR expects pupils to give. In an exam answer, name the benefit AND explain it.

Reuse: area(w, h) can be called for every room in a house without writing the multiplication again. Easier to test: each subprogram can be tested on its own with normal, boundary and invalid data (lesson 20). Easier to maintain: if the bonus rule changes, only the addBonus function changes and every call uses the new rule; the code is also easier to read because each block has a meaningful name. Decomposition (lesson 15): the problem is broken into smaller subproblems, and in a team each programmer can write and test different subprograms at the same time.

Device-free: pupils write one benefit as a full exam sentence, for example "Subprograms can be reused, so the code only has to be written once, which saves time."

01 · LEARN · READING A FILE

Open, read line by line, close

▮ TERMINAL // readnames.erl

1  myFile = open("names.txt")

2  while NOT myFile.endOfFile()

3      print(myFile.readLine())

4  endwhile

5  myFile.close()

 

> Kofi  > Megan  > Hamza

▮ TERMINAL // readnames.py

1  myFile = open("names.txt", "r")

2  line = myFile.readline()

3  while line != "":

4      print(line.strip())

5      line = myFile.readline()

6  myFile.close()

 

> Kofi  > Megan  > Hamza

names.txt

Kofi

Megan

Hamza

endOfFile() is True once every line has been read, so the loop stops.

Python: "r" opens to read; readline() gives "" at the end; .strip() removes the line break.

Variables are lost when a program stops. A text file on the disk keeps data between runs: high scores, settings, a class list. Every file job follows the same pattern: OPEN the file, READ or WRITE, then CLOSE it.

Left, OCR Exam Reference Language (OCR's own pattern): open("names.txt") opens the file and stores it in myFile. myFile.endOfFile() is True when there are no more lines, so while NOT myFile.endOfFile() keeps going while there is still something to read. Each myFile.readLine() reads the NEXT line, so the loop prints Kofi, Megan, Hamza. myFile.close() closes the file.

Right, Python (click to reveal): open("names.txt", "r") opens the file in read mode. readline() reads one line, including its line break; at the end of the file it returns an empty string "", which stops the loop. .strip() removes the line break so print does not add blank lines. Checked in Python 3 with a temporary names.txt: the output is Kofi, Megan, Hamza on three lines.

Python also has a shorter loop: with open("names.txt", "r") as myFile: then for line in myFile: print(line.strip()). The with block closes the file automatically.

Why close a file: it frees the file for other programs and makes sure everything written is actually saved.

Device-free: pupils trace the ERL loop for a file holding four names and write what is printed.

01 · LEARN · WRITING A FILE

Create, write, close

▮ TERMINAL // savescores.erl

1  newFile("scores.txt")

2  myFile = open("scores.txt")

3  myFile.writeLine("Kofi,18")

4  myFile.writeLine("Megan,20")

5  myFile.close()

▮ TERMINAL // savescores.py

1  myFile = open("scores.txt", "w")

2  myFile.write("Kofi,18\n")

3  myFile.write("Megan,20\n")

4  myFile.close()

scores.txt

Kofi,18

Megan,20

ERL: newFile() creates an empty file; writeLine() adds one line.

Python: "w" creates or wipes the file; "a" adds to the end. \n starts a new line.

with open("scores.txt", "a") as f: closes the file for you.

Writing follows the same pattern: open, write, close.

Left, OCR ERL: newFile("scores.txt") creates a new, empty text file. open() opens it, each writeLine() writes one line to the file, and close() closes it. Afterwards scores.txt holds two lines: Kofi,18 and Megan,20 (shown bottom left). Nothing is printed on screen: the output goes to the file.

Right, Python (click to reveal): open with mode "w" (write) creates the file, or WIPES it if it already exists. write() does not add a line break by itself, so each line ends with \n. Checked in Python 3: the file then holds exactly Kofi,18 and Megan,20 on two lines.

Mode "a" (append) keeps what is there and adds to the end: with open("scores.txt", "a") as f: then f.write("Hamza,17\n") indented underneath would add a third line, and the with block closes the file automatically (checked in Python 3).

Common exam mistakes: forgetting to close the file, and using "w" when the old data should be kept.

Device-free: pupils write the ERL to add one more line, Hamza,17, to a file called scores.txt (open, writeLine, close).

01 · LEARN · SQL

Search a table of records with SQL

▮ TABLE // Pupils

Name   | Form | Age | House

-------+------+-----+------

Amara  | 10B  | 15  | Red

Callum | 11A  | 16  | Blue

Priya  | 10A  | 14  | Red

Tomasz | 11B  | 16  | Red

Grace  | 10B  | 15  | Green

Yusuf  | 11A  | 15  | Blue

Each row is one record (one pupil).

Each column is a field: Name, Form, Age, House.

SELECT which fields to show

FROM which table

WHERE which records match a condition

▮ TERMINAL // query1.sql

SELECT Name, Form

FROM Pupils

WHERE House = 'Red'

Name   | Form

Amara  | 10B

Priya  | 10A

Tomasz | 11B

A database stores records in tables. This table, Pupils, has six records (rows) and four fields (columns): Name, Form, Age and House. This links back to records in lesson 24: each row is one record.

SQL (Structured Query Language) is used to search a database. OCR expects three keywords: SELECT names the fields to show, FROM names the table, and WHERE gives the condition a record must meet.

Click to reveal query 1 and its result. Check each row in turn: Amara Red yes, Callum Blue no, Priya Red yes, Tomasz Red yes, Grace Green no, Yusuf Blue no. Only the Name and Form fields are shown, because those are the fields after SELECT. Result: Amara 10B, Priya 10A, Tomasz 11B (checked with Python 3 and sqlite3).

Text values go in quote marks ('Red'); numbers do not. OCR mark schemes accept single or double quote marks.

Device-free: pupils write the query to show the Name of every pupil in form 10B (SELECT Name FROM Pupils WHERE Form = '10B': Amara and Grace).

01 · LEARN · SQL CONDITIONS

All fields, two conditions, a wildcard

* every field

AND both true · OR at least one

= > < >= <= compare

LIKE with % for any characters

▮ TERMINAL // query2.sql

SELECT *

FROM Pupils

WHERE Age > 15 AND House = 'Blue'

> Callum | 11A | 16 | Blue

▮ TERMINAL // query3.sql

SELECT Name

FROM Pupils

WHERE Form LIKE '11%'

> Callum  > Tomasz  > Yusuf

The same Pupils table is shown on the left. Click to reveal each query; ask pupils to predict the result first and check row by row.

Query 2: SELECT * shows every field. AND means BOTH conditions must be true. Age > 15 is true for Callum (16) and Tomasz (16); House = 'Blue' is true for Callum and Yusuf. Only Callum meets both. Yusuf is 15, and 15 > 15 is false. Result: Callum, 11A, 16, Blue.

Query 3: LIKE with the wildcard % matches any characters (or none). '11%' means "starts with 11", so it finds forms 11A and 11B: Callum, Tomasz, Yusuf.

OR means AT LEAST ONE condition is true: WHERE House = 'Green' OR Age < 15 finds Grace (Green) and Priya (14). Comparison operators: = equal, > greater than, < less than, >= greater than or equal, <= less than or equal, and <> or != for not equal.

All results checked with Python 3 and sqlite3 on this exact table.

Device-free: pupils write the query to show the Name and House of every pupil aged 16 or more (WHERE Age >= 16: Callum Blue, Tomasz Red).

01 · LEARN · THE BIG IDEA

A table is a drawer of records

1  The drawer is the table.

2  Each card is one record.

3  Each line on a card is a field.

4  WHERE pulls out only the cards that match.

5  SELECT copies down only the lines you need.

Remember: SELECT fields FROM table WHERE condition.

Click to reveal the points. The picture is the idea to remember: a drawer of index cards, the way records were kept before computers. The whole drawer is a table. Each card is one record, about one thing (one pupil, one book). Each line on a card is a field, and every card has the same fields in the same order.

Searching with SQL is like going through the drawer: WHERE House = 'Red' pulls out only the cards for Red pupils, and SELECT Name, Form copies down only those two lines from each card. A database does the same search in a fraction of a second, even with millions of cards.

Photo: Maksym Kaharlytskyi / Unsplash.

Device-free: pupils draw one card for themselves with the fields Name, Form, Age and House. Image credit: Maksym Kaharlytskyi / Unsplash

01 · LEARN · SUMMARY

Function, procedure or SQL?

FUNCTION

Does a job and returns a value.

a = area(3, 4)

PROCEDURE

Does a job, returns nothing.

greet("Zara")

SQL

Finds the records that match.

SELECT fields FROM table WHERE condition

SYSTEM VOICE · KEY DEFINITION

Key definition. A subprogram is a named block of code that does one job. A function returns a value. A procedure does not return a value. A parameter is a variable that receives a value when the subprogram is called.

Play the key definition, then go through the three cards.

Function: does a job and RETURNS a value, so it can be used in an expression or stored, as in a = area(3, 4). Procedure: does a job but returns nothing, so it is called as a statement on its own, as in greet("Zara"). Both are subprograms and both can take parameters. SQL is not a subprogram: it is the language used to search a database table, written as SELECT fields FROM table WHERE condition.

Quick test: "a subprogram that works out VAT on a price" is a function (it hands back a number). "A subprogram that draws a menu on the screen" is a procedure.

Device-free: pupils write the key definition in their own words.

Function, procedure or both? Drag each card.

FUNCTION

PROCEDURE

BOTH




Does a job but hands nothing back

Always sends a value back with return

Its result can be stored: a = area(3, 4)

Can take parameters

Can be called again and again

Ends with endprocedure in ERL

Answers. Function: always sends a value back with return; its result can be stored, as in a = area(3, 4). Procedure: does a job but hands nothing back; ends with endprocedure in ERL. Both: can take parameters; can be called again and again.

Discuss: why can greet("Zara") not be stored in a variable? Because a procedure returns nothing. (In Python, storing a procedure call gives None.) Both kinds of subprogram can take parameters, and both can be reused: that reuse is the main benefit of subprograms.

Device-free: pupils draw three columns and write each statement in the right one.

How many records does this return? SELECT Name FROM Pupils WHERE House = 'Green' OR Age < 15

A

1

B

3

C

2

D

4

Answer: C, 2. OR means at least one condition must be true. Check each record: Amara Red 15 no; Callum Blue 16 no; Priya Red 14 YES (14 < 15); Tomasz Red 16 no; Grace Green 15 YES (house is Green); Yusuf Blue 15 no. So 2 records: Priya and Grace (checked with Python 3 and sqlite3).

1 counts only the Green pupil and forgets the OR. 3 adds one record too many, for example Amara (15 is not less than 15). 4 counts every pupil aged 15 or under (Age <= 15) instead of under 15.

Picture: the Pupils table from the SQL slides.

Device-free: students hold up A, B, C or D cards.

function double(n) returns n * 2. What does print(double(double(3))) output?

A

12

B

6

C

36

D

24

Answer: A, 12. Work from the inside out: double(3) returns 6, then double(6) returns 12, which is printed. The value a function returns can be passed straight into another call. In ERL: function double(n) / return n 2 / endfunction. Checked in Python 3 with def double(n): return n 2.

6 stops after one call. 36 squares 6 instead of doubling it. 24 doubles three times.

Photo: Tim Mossholder / Unsplash (gears: the output of one feeds the next).

Device-free: students hold up A, B, C or D cards. Image credit: Tim Mossholder / Unsplash

03 · DEBUG · SPOT THE MISTAKE

One line in Oliwia's code is wrong

▮ TERMINAL // oliwia_names.erl

1  myFile = open("names.txt")

2  while myFile.endOfFile()

3      print(myFile.readLine())

4  endwhile

5  myFile.close()

It should print every name in the file. Run it in your head, then tap the marker.

Tip: ask what endOfFile() gives before the first line has been read.

Give a minute to find the mistake before tapping the marker. Oliwia wants to print every name in names.txt.

Answer: line 2. endOfFile() is True only when there is nothing left to read. Before the first line is read it is False, so while myFile.endOfFile() is False straight away and the loop body never runs: nothing is printed. The fix is while NOT myFile.endOfFile(), which keeps looping while there are still lines to read.

The other lines are correct: line 1 opens the file, line 3 reads and prints the next line, line 4 ends the loop and line 5 closes the file. In Python the same mistake would be while line == "": instead of while line != "":.

Device-free: copy the five lines onto the board; pupils write the wrong line number and the corrected line.

1

Read the next line

2

Output the line

3

Open the file

4

Repeat until the end of the file

5

Close the file

6

Check whether the end of the file has been reached

Put the steps for reading every line of a file in order.

Correct order: 1 open the file; 2 check whether the end of the file has been reached; 3 read the next line; 4 output the line; 5 repeat until the end of the file; 6 close the file.

In code: myFile = open("names.txt") (step 1), while NOT myFile.endOfFile() (steps 2 and 5), print(myFile.readLine()) (steps 3 and 4), endwhile, then myFile.close() (step 6). Common mistakes: closing the file inside the loop, or reading before checking for the end of the file.

Device-free: pupils write the six steps on sticky notes and order them on the desk.

Complete the summary.

A function returns a value, but a procedure does not. The values passed in when a subprogram is called are arguments. A local variable only exists inside its subprogram. A file is opened, read or written, then closed. In SQL, SELECT names the fields, FROM names the table and WHERE gives the condition.

function
procedure
arguments
local
closed
SELECT
WHERE
global
parameters
FIND

Answers in order: function, procedure, arguments, local, closed, SELECT, WHERE. Distractors: global, parameters, FIND.

Parameters are the names in the brackets of the definition; the actual values passed in when it is called are arguments. A global variable can be used anywhere, the opposite of local. FIND is not an SQL keyword.

Device-free: paragraph on the board with gaps and the word bank; pupils write the seven missing words.

EXAM · Write a function called larger that takes two numbers as parameters and returns the larger one. [4 marks]

Exam-style question, 4 marks. Give 6 minutes. Pupils may answer in OCR Exam Reference Language or Python. If both numbers are the same, returning either one is correct. The model answer is on the next slide.

Mark scheme: 1 mark each. Defines a function called larger with two parameters. Compares the two parameters (for example a > b). Returns the first number when it is larger. Returns the second number otherwise.

Do not award the return marks for print instead of return: the question asks for the value to be returned.

Device-free: pupils answer on paper, then peer-mark with the next slide.

04 · EXAM · MODEL ANSWER

Compare, then return

▮ TERMINAL // larger.erl

1  function larger(a, b)

2      if a > b then

3          return a

4      else

5          return b

6      endif

7  endfunction

 

print(larger(7, 12))  // 12

MARK SCHEME

1 mark: function larger with two parameters

1 mark: compare the two numbers

1 mark: return a if it is larger

1 mark: otherwise return b

Python is also accepted.

Click to reveal the model answer line by line. Line 1 names the function and its two parameters, a and b. Line 2 compares them. If a is bigger, line 3 returns a; otherwise line 5 returns b (which also covers the case where they are equal). The last line shows a call: larger(7, 12) returns 12.

Python version (also accepted): def larger(a, b): then, indented, if a > b: return a, else: return b. Checked in Python 3: larger(7, 12) and larger(12, 7) both give 12, and larger(5, 5) gives 5.

Common mistakes: printing instead of returning, missing parameters (using input() inside the function instead), or forgetting endfunction in ERL.

Device-free: pupils tick each mark-scheme point on their own answer and correct it in a different colour.

How sure are you about subprograms and SQL?

1

Very: I can write functions and queries

2

Fairly: files or SQL still trip me up

3

Not yet: I need another go

Anonymous exit poll. If many pupils are unsure, use the Pupils table again at the start of lesson 26: pupils write one query each and swap with a partner to work out the result.

Device-free: thumbs up, sideways or down.

05 · NEXT · KEEP GOING

Keep going

Isaac Computer Science

Free online lessons and questions. Look for the topics on subroutines, file handling and SQL.

BBC Bitesize

GCSE Computer Science, OCR: revise subprograms and searching data with SQL.

Try it in Python

Write a function that returns the average of three numbers, then save the answer to a file.

Next lesson: the last one. Exam rehearsal for Paper 1 and Paper 2.

Point pupils to the places to practise. Isaac Computer Science and BBC Bitesize are free.

The Python challenge, as a model: def average(a, b, c): return (a + b + c) / 3, then result = average(4, 5, 9), then with open("average.txt", "w") as f: f.write(str(result)) indented underneath. average(4, 5, 9) returns 6.0, so the file holds 6.0 (str() is needed because write() only takes a string).

Next lesson (26, the last in the series) is exam rehearsal for Paper 1 and Paper 2: bring questions on any topic.

Device-free: pupils write the program on paper to bring to lesson 26.