Computer Science GCES OCR
-
Cpu Architecture Performance And Embedded Systems Ocr5 主题
-
Primary And Secondary Storage Ocr6 主题
-
Data Storage And Compression Ocr12 主题
-
Units Of Data Storage Ocr
-
Processing Binary Data Ocr
-
Data Capacity And Calculating Capacity Requirements Ocr
-
Converting Between Denary And Binary Ocr
-
Binary Addition Ocr
-
Converting Between Denary And Hexadecimal Ocr
-
Converting Between Binary And Hexadecimal Ocr
-
Binary Shifts Ocr
-
Representing Characters Ocr
-
Representing Images Ocr
-
Representing Sound Ocr
-
Compression Ocr
-
Units Of Data Storage Ocr
-
Networks And Topologies Ocr6 主题
-
Wired And Wireless Networks Protocols And Layers Ocr6 主题
-
Identifying And Preventing Threats To Computer Systems And Networks Ocr2 主题
-
Operating Systems And Utility Software Ocr2 主题
-
Ethical Legal Cultural And Environmental Impact Ocr2 主题
-
Computational Thinking Searching And Sorting Algorithms Ocr3 主题
-
Designing Creating And Refining Algorithms Ocr5 主题
-
Programming Fundamentals And Data Types Ocr5 主题
-
Additional Programming Techniques Ocr7 主题
-
Defensive Design And Testing Ocr6 主题
-
Boolean Logic Diagrams Ocr2 主题
-
Programming Languages And Integrated Development Environments Ides Ocr3 主题
-
The Exam Papers Ocr2 主题
-
Structuring Your Responses Ocr3 主题
Trace Tables Ocr
Exam code:J277
Trace Tables
What is a trace table?
-
A trace table is used 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