0% found this document useful (0 votes)
281 views22 pages

CSEC IT Notes - Term 2 Week 3 Trace Tables

This document discusses trace tables and their use in testing algorithms and programs. It begins with a recap of control structures like sequence, selection, and repetition. It then discusses writing algorithms and Pascal programs using loops. The objectives are explained as using a trace table to do a 'dry run' of a program to test it, and examples are given of how to construct and use trace tables. Several past exam questions are presented and students are tasked with working through these examples and the external homework links provided.

Uploaded by

kxng ultimate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
281 views22 pages

CSEC IT Notes - Term 2 Week 3 Trace Tables

This document discusses trace tables and their use in testing algorithms and programs. It begins with a recap of control structures like sequence, selection, and repetition. It then discusses writing algorithms and Pascal programs using loops. The objectives are explained as using a trace table to do a 'dry run' of a program to test it, and examples are given of how to construct and use trace tables. Several past exam questions are presented and students are tasked with working through these examples and the external homework links provided.

Uploaded by

kxng ultimate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

CSEC Information Technology

TERM 2 WEEK 3- TRACE TABLES


Recap of previous class

 Review 3 methods of control in algorithm development


 Sequence, Selection, Repetition
 Pseudocode – Use of read, input, store, write, print, output, display, conditional branching (if-then, if-then-
else, nested conditions); loops (for, while, repeat). Use of relational operators: =, <=, > =,< >. Logical
operators: AND, OR, NOT; use of truth tables. Arithmetic operators: +‚ –‚ *, /, MOD, DIV

 Write algorithms and Pascal programs using loops.


Homework Q1
3
Homework Q1 Solution
5

Homework Q1

3 4.5 6
Objectives

• What is meant by a ‘dry run’

• The purpose of a trace table

• Examples of how to use a trace table to test a program


Dry Run
Trace Table
Example 1

X Y OUTPUT
3
1 4
2 6
3 9
4 13 13
Past Paper June 2008 P2 Q14

Line1, Line 7
Line 4
Line 9

3 8 9
3 11 20
20
Past Paper May 2011 P2 Q11

4
6
8

4
To increment result by 2 or find
multiples of 2
Past Paper Jan 2012 P2 Q 9

2 10
2 5
2 2

MOD
Past Paper Jan 2014 P2 Q10

3 2
1 4 8
2 6 12
3 9 18
4 13 26
Homework

 Go through the previous slides and do the Past Paper questions on the next few slides and
the quiz and activity on the last slide.
Past Paper May 2021 P2 3
Past Paper May 2021 P2
Past Paper May 2021 P2 Q4
Past Paper May 2021 P2 Q4
Past Paper Jan 2013 P2 Q4
Past Paper May/Jun 2014 P2
21

Past Paper Jan 2013 P2


Homework

 Click on the hyperlink below and complete the task given.

 https://www.101computing.net/using-trace-tables/

 https://www.bbc.co.uk/bitesize/guides/zpp49j6/revision/1

You might also like