Desk Check Technique Overview
Desk Check Technique Overview
Home Page
[Link] 1/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
0000 - Test 2015 Past Paper 4. An Input/Output column is used to show what is input by the user and displayed by the
00TEST 1 program. Show inputs with: the variable name, a "?" and the value input e.g. price ? 200. Show
1 Access In class outputs with the variable name, an =, and the value displayed (or just the value displayed) e.g.
1. Sat Feb 9 discountPrice= 180 .
[Link] Fundamentals of Hardware Normally portrait page layout would be used for the desk check, however if the table is too wide,
and Software
landscape layout may be used.
MEMORY
Software Desk Checks vs Test Plans
13/12/16
3/14/2017 TEST A Desk Check concentrates on the value of variables and the logic i.e. what is the value of variable x
BLOG
after statement n; what is the next statement to be executed? A Test Plan focuses on the values of inputs
Practice Exam
and outputs required to test a program without concern for the internal workings i.e. are the results
(outputs) correct for the inputs?.
Class Work 17-11-2015
Class Work Dec 3, 2016
DATA REPRESENTATION
Example 1
1. Binary Algebra Problem Description: Calculate the discounted price of an item purchased. (Note: a problem
2. Hexadecimal description is not normally specified in a desk check, it is only included to assist in understanding the
[Link] to HEX problem.)
[Link]
CLASS WORK The following example shows desk checking involving sequence, executing instructions one after the
NOV 16 Class work other.
DATA SECURITY Sequence involves executing all instructions once, from top to bottom, one after the other.
DATA SECURITY/COM TEST
Hierarchy Chart Algorithm (with line numbers added for the Desk Check)
Information Processing 1 calcDiscountPrice()
Information Processing
Questions 2 Input price, discountPercent
Latest News
3 discount = price * discountPercent / 100
Untitled Post
Networking / Data Communication 4 discountPrice = price - discount
19-4-2016
5 Display discountPrice
PAST PAPERS
Practice Questions 6 STOP
Test Page
Problem Solving and
Desk Check
Programming
Test Data
ARRAYS
[Link] 2/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
Past Papers
Example 2
Home Problem Description: Calculate the discounted price of an item purchased. Customers receive a
Sitemap discount of 15% on an item if the purchase price of the item is over $100.
The following example shows desk checking involving selection using an IF.
For an IF without an ELSE, if the condition evaluates to True then execution continues to the next line
and the lines between the IF and ENDIF are executed (inclusive), otherwise (the condition is False)
execution jumps from the IF to the ENDIF.
Algorithm (with line numbers added for the Desk Check)
1 calcPrice()
2 Input price
6 ENDIF
7 Display price
8 STOP
Desk Check
Inputs: price = $200
Correct results: price = $170.
4 200 * 15 / 100 = 30
5 200 - 30 = 170
7 price = 170
2 50 price ? 50
[Link] 4/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
3 50 > 100 ? is F
7 price = 50
Example 3
Problem Description: Display whether a student passed or failed a subject depending on their mark.
The following example shows desk checking involving selection using an IF-ELSE.
For an IF-ELSE, if the condition evaluates to True, execution continues to the next line after the IF and
the lines up to but excluding the ELSE are executed, then execution jumps to the ENDIF. If the
condition is False, execution jump from the IF to the ELSE, and the lines from the ELSE to the ENDIF
(inclusive) are executed.
Algorithm (with line numbers added for the Desk Check)
1 displayGrade()
2 Input mark
4 grade = "Pass"
6 ELSE
8 ENDIF
9 Display grade
10 STOP
Desk Check
[Link] 5/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
Inputs: mark = 75
Correct results: grade = "Pass", "Well done"
2 75 mark ? 75
3 75 >= 50 ? is T
4 Pass
5 "Well done"
9 Pass
10
Desk Check
Inputs: mark = 40
Correct results: grade = "Not pass"
2 40 mark ? 40
3 40 >= 50 ? is F
[Link] 6/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
9 Not pass
10
Example 4
Problem Description: Calculate the cost of electricity based on the electricity used.
The following example shows desk checking involving selection using a linear nested IF-ELSEs.
Algorithm (with line numbers added for the Desk Check)
1 calcElectrictyCost()
2 Input electricityUsed
4 cost = 100
5 usageLevel = "Low"
6 ELSE
9 usageLevel = "Moderate"
10 ELSE
12 usageLevel = "High"
13 ENDIF
14 ENDIF
16 STOP
[Link] 7/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
Desk Check
Inputs: electricityUsed = 500,
Correct results: cost = 100, usageLevel = "Low".
Line Number cost electricity Used usage Level Conditions Input/ Output
4 100
5 Low
14
16
[Link] 8/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
8 100 + (3000-1000)
* 0.1 = 300
9 Moderate
13
14
16
10
[Link] 9/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
11 500 + (15000-5000) *
0.08 = 1300
12 High
13
14
16
Example 5
Problem Description: Calculate the cost of water based on the water used and whether the customer is a
Domestic or Commercial user.
The following example shows desk checking involving selection using a non-linear nested IF-ELSEs.
Algorithm (with line numbers added for the Desk Check)
1 calcWaterCost()
2 Input waterUsed
4 cost = 50
5 ELSE
6 Input customerType
9 ELSE
[Link] 10/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
11 Display "Commercial rate"
12 ENDIF
14 ENDIF
15 Display cost
16 STOP
Desk Check
Inputs: waterUsed = 70, customerType (not required)
Correct results: cost = 50
Line Number cost customer Type water Used Conditions Input/ Output
2 70 waterUsed ? 70
3 70 < 100 ? is T
4 50
14
15 cost = 50
16
Line Number cost customer Type water Used Conditions Input/ Output
[Link] 11/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
6 D customerType ? D
7 D = D ? is T
12
13 High usage
14
15 cost = 100
16
Line Number cost customer Type water Used Conditions Input/ Output
6 C customerType ? C
[Link] 12/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
7 C = D ? is F
11 Commercial rate
12
13 High usage
14
15 cost = 120
16
Example 6
Problem Description: Display a table of values of x and x squared. X is to start at 1 and increase by 1
up to 3.
The following example shows desk checking involving iteration (repetition) using a FOR loop.
The counter variable is initialized once at the top of the loop, the first time through the loop. The
implied condition is evaluated at the top of the loop, with execution going to the next line if the
condition is True and going to the line after the ENDFOR if the condition is False. In this case the
implied condition is x <= 3 ?. On the ENDFOR line the counter variable is incremented by 1, then
program execution loops from the ENDFOR line, back to the FOR line.
Algorithm (with line numbers added for the Desk Check)
1 calcSquares()
3 FOR x = 1 TO 3 DO
4 xSquared = x * x
[Link] 13/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
5 Display x, xSquared
6 ENDFOR
7 Display "-----------"
8 STOP
Desk Check
Test Data
Input: None
Correct results: x = 1, xSquared = 1; x = 2, xSquared = 4; x = 3, xSquared = 9.
2 X, X Squared
3 1 1 <= 3 ? is T
4 1*1=1
5 x = 1, xSquared = 1
6 1+1=2
3 2 <= 3 ? is T
4 2*2=4
5 x = 2, xSquared = 4
6 2+1=3
3 3 <= 3 ? is T
4 3*3=9
[Link] 14/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
5 x = 3, xSquared = 9
6 3+1=4
3 4 <= 3? is F
7 -----------
Example 7
Problem Description: Total a series of number input by the user. Allow the user to continue inputting
numbers until a negative number is input, then display the total of the numbers input.
The following example shows desk checking involving iteration (repetition) using a WHILE loop.
The condition is evaluated at the top of the loop, with execution going to the next line if the condition
is True and going to the line after the ENDWHILE if the condition is False. Program execution loops
from the ENDWHILE line, back to the WHILE line.
Algorithm (with line numbers added for the Desk Check)
1 totalNumbers()
2 total = 0
3 Input number
6 Input number
7 ENDWHILE
8 Display total
9 STOP
Desk Check
[Link] 15/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
2 0
3 10 number ? 10
4 10 >= 0 ? is T
5 0 + 10 = 10
6 6 number ? 6
4 6 >= 0 ? is T
5 10 + 6 = 16
6 -1 number ? -1
4 -1 >= 0 ? is F
8 total = 16
Example 8
Problem Description: Calculate the membership fee for club members.
The following example shows desk checking involving sequence, selection and iteration (repetition).
[Link] 16/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
2 totalFees = 0
3 Input membershipType
6 membershipFee = 160
7 membershipName = "Full"
8 ELSE
10 membershipFee = 80
11 membershipName = "Junior"
12 ELSE
13 IF membershipType = "P"
14 membershipFee = 30
15 membershipName = "Pensioner"
16 ELSE
17 membershipFee = 10
18 membershipName = "Life"
19 ENDIF
20 ENDIF
21 ENDIF
24 Input membershipType
[Link] 17/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
25 ENDWHILE
26 Display totalFees
27 STOP
Desk Check
Inputs: membershipType = "J", membershipType = "F", membershipType = "X".
Correct results: membershipFee = 80, membershipName = "Junior"; membershipFee = 160,
membershipName = "Full"; totalFees = 240.
2 0
3 J membership Type ? J
4 J <> X ? is
T
5 J = F? is F
9 J = J ? is T
10 80
11 Junior
20
21
22 0 + 80
[Link] 18/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
= 80
24 F membership Type ? F
25
4 F <> X ? is
T
5 F = F? is T
6 160
7 Full
21
22 80 +
160 =
240
23 membership Fee =
160, membership
Name = Full
24 X membership Type ? X
25
4 X <> X ? is
F
26 totalFees = 240
27
[Link] 19/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
Example 9
Problem Description: find the smallest of 3 numbers.
The following example shows desk checking involving subroutines.
When a subroutine is called, execution goes from the calling line (subroutine call e.g. line 3 in this
example) to the first line in the subroutine (e.g. line 6). The subroutine is then executed, and when the
end of the subroutine is reached (e.g. line 14), execution goes back to the line after where it was
originally called (e.g. line 4).
Algorithm (with line numbers added for the Desk Check)
1 compareNumbers()
3 getSmallestNumber()
4 Display smallest
5 STOP
6 getSmallestNumber()
7 smallest = number1
9 smallest = number2
10 ENDIF
12 smallest = number3
13 ENDIF
14 EXIT
Desk Check
[Link] 20/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
2 5 3 8 number1 ? 5; number2 ? 3;
number3 ? 8
7 5
8 3 < 5 ? is T
9 3
10
11 8 < 3 ? is F
13
14
4 smallest = 3
[Link] 21/22
23/08/2023, 09:49 Desk Check Guide - INFORMATION TECHNOLOGY
7 7
8 12 < 7 ? is
F
10
11 9 < 7 ? is F
13
14
4 smallest = 7
Comments
Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites
[Link] 22/22