Thursday, November 24, 2005

Trace Tables

Trace tables help you check (trace) the program line by line, and see what is happening to each variable as the program is executed.

Take this simple program:

x=5
t=1
d=t+x
x=t+d
t=t*x
print x,t,d

It would be complicated to figure out the values of each variable at the end. A trace table makes it simple:

Put the names of the variables at the top of columns in a table:

x t d
As the first line is executed we get 5 0 0 (t and d are still 0)
On the next line it becomes 5 1 0
On the third line d=t+x 5 1 6
On the fourth line x=t+d 7 1 6 (t,d don't change)
On the fifth t=t*x 7 7 6

So the final values of the variables are 7, 7 and 6.

Since we have a "print" statement, we would add it to the column headings. The actual table could be rewritten like this, combining lines 1,2 and 3 into 1 line on the table :

x t d print
5 1 6 -
7 7 6 7,7,6


Following the work in class, try this example for homework (due 1 December 2005 at 8.50am)


g=5
h=2
for d=1 to 5
h=h*h
g=h+g
next d
print d,g,h


A prep session for this will be offered on Thursday lunchtime 1-1.20pm in Room 21, and again Monday 3.10-3.50pm (to include revision of the SBA)

Thursday, November 03, 2005

Test Preparation

Your Session 1 theory test will take place on Thursday 10th November.
The overall grade for session 1 will be made up of:

Theory Test
SBA Practice (Database, Spreadsheet, Word Processing)
Project
Spreadsheet Revision Test
Database Revision Test

Notes for revision of theory test:

Make sure you have thought about advantages and disadvantages of each of the areas of study - e.g.

"Why is it useful to use an expert system?"

"What would be a drawback of using an expert system?"

Revision notes for practical tests

Database: make sure you understand SELECT QUERY, UPDATE QUERY, APPEND QUERY
REPORTS
Spreadsheet: ensure you can do CALCULATE PERCENTAGES, NAME CELLS, LOOKUP
SHOW FORMULAE

There will be revision prep on Monday 7th November at 3.00pm ALL WELCOME!!!!