0% found this document useful (0 votes)
21 views6 pages

7.7 Trace Tables

The document outlines the creation of trace tables for various algorithms, including one that sums five input numbers and another that calculates exam marks until a sentinel value of -1 is entered. It provides specific test data for each algorithm to illustrate how the trace tables should be completed. Additionally, there is a mention of another test data set involving decimal values for further analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

7.7 Trace Tables

The document outlines the creation of trace tables for various algorithms, including one that sums five input numbers and another that calculates exam marks until a sentinel value of -1 is entered. It provides specific test data for each algorithm to illustrate how the trace tables should be completed. Additionally, there is a mention of another test data set involving decimal values for further analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Trace Table

Example:

N1=0, N2=0, Sum=0


INPUT N1, N2
Sum= N1 + N2
OUTPUT Sum

To test this algorithm you are given the following


test data:
4, 7
8, 4

N1 N2 Sum Output
Trace Tables

1. This flowchart inputs 5 numbers and finds the sum of these numbers

Complete the trace table for the n input data: 3, 6, 7, 4, 8

sum count n output


2. This flowchart inputs the marks gained in an examination. An input of –1 ends the routine.

START

Total 0
Count 0
Distinction 0

INPUT Mark

Is Mark = –1? Yes


Total Total + Mark
Count Count + 1

No

No Is OUTPUT "Number of
Mark >= Distinctions ", Distinction
80 OUTPUT "Average Mark "
? Total/Count
Yes

Distinction Distinction + 1 END

Complete the trace table for the mark input data: 50, 70, 65, 30, 95, 50, 55, 85, 65, 35, –1, 45

Total Count Distinction Mark OUTPUT

[4]
To test this algorithm you are given the following test data:

1.8, 2.0, 1.0, 1.3, 1.0, 2.5, 2.0, 1.3, 1.8, 1.3, -1

Engine Count Number Size Average Output


4.

You might also like