Computer Science GCES AQA
-
Representing Algorithms Aqa4 主题
-
Efficiency Of Algorithms Aqa1 主题
-
Searching Algorithms Aqa3 主题
-
Sorting Algorithms Aqa3 主题
-
Data Types Aqa1 主题
-
Programming Concepts Aqa5 主题
-
Arithmetic Relational And Boolean Operations Aqa1 主题
-
Data Structures Aqa3 主题
-
String Manipulation Aqa1 主题
-
Random Number Generation Aqa1 主题
-
Structured Programming Aqa2 主题
-
Robust And Secure Programming Aqa4 主题
-
Number Bases Aqa2 主题
-
Converting Between Number Bases Aqa3 主题
-
Units Of Information Aqa9 主题
-
Hardware And Software Aqa4 主题
-
Boolean Logic Aqa3 主题
-
Programming Languages And Translators Aqa2 主题
-
Cpu Architecture Performance And Embedded Systems Aqa4 主题
-
Memory Aqa2 主题
-
Secondary Storage Aqa3 主题
-
Fundamentals Of Computer Networks Aqa8 主题
-
Fundamentals Of Cyber Security Aqa1 主题
-
Methods Of Preventing Cyber Security Threats Aqa1 主题
-
Relational Databases Aqa2 主题
-
Ethical Legal And Environmental Impacts Aqa2 主题
Tracing Algorithms Aqa
Exam code:8525
Tracing Algorithms
What is a trace table?
-
A trace table is used to trace through an algorithm and to test algorithms and programs for logic errors that appear when an algorithm or program executes
-
Trace tables can be used with flowcharts, pseudocode or program code
-
A trace table can be used to:
-
Discover the purpose of an algorithm by showing output data and intermediary steps
-
Record the state of the algorithm at each step or iteration
-
-
Each stage of the algorithm is executed step by step.
-
Inputs, outputs, variables and processes can be checked for the correct value when the stage is completed
Trace table walkthrough
-
Below is a flowchart to determine the highest number of ten user-entered numbers
-
The algorithm prompts the user to enter the first number which automatically becomes the highest number entered
-
The user is then prompted to enter nine more numbers.
-
If a new number is higher than an older number then it is replaced
-
-
Once all ten numbers are entered, the algorithm outputs which number was the highest
-
Example test data to be used is: 4, 3, 7, 1, 8, 3, 6, 9, 12, 10

|
Trace table: Highest number |
|||
|---|---|---|---|
|
Count |
Highest |
Number |
Output |
|
1 |
|
|
Enter ten numbers |
|
|
4 |
|
Enter your first number |
|
2 |
|
3 |
Enter your next number |
|
3 |
7 |
7 |
|
|
4 |
|
1 |
|
|
5 |
8 |
8 |
|
|
6 |
|
3 |
|
|
7 |
|
6 |
|
|
8 |
9 |
9 |
|
|
9 |
12 |
12 |
|
|
10 |
|
10 |
12 is your highest number |
Worked Example
|
01 |
|
|
02 |
|
|
03 |
|
|
04 |
|
|
05 |
|
|
06 |
|
Complete the following trace table for the given algorithm, the first two lines have been filled in for you

Answer

Responses