You are on page 1of 3

Computer Science Assignment # 2

2.1 Algorithm Design and Problem Solving

2.1.1 Problem Solving and Design


1. A program is to be written to calculate the scholarship given on grades.
A grade may qualify for a scholarship depending on the number of A’s achieved. The
grades(AGrades), the fees(Fees), the scholarship (Scholarship) and fees to be paid after
scholarship achieved (FeesAmount) is calculated as shown in the following pseudocode
algorithm.

INPUT AGrades, Fees


IF AGrades > 7
THEN
Scholarship ← 1
ELSE
IF AGrades > 5
THEN
Scholarship ← 0.5
ELSE
Scholarship ← 0
ENDIF
ENDIF
FeesAmount ← Fees - (Fees * Scholarship)
OUTPUT Paid
The algorithm is also to be documented with a program flowchart.
Complete the flowchart by:
• filling in the flowchart boxes
• labelling, where appropriate, lines of the flowchart

Page 1 of 3
Computer Science Assignment # 2
2.1 Algorithm Design and Problem Solving

2.1.1 Problem Solving and Design

[8]

Page 2 of 3
Computer Science Assignment # 2
2.1 Algorithm Design and Problem Solving

2.1.1 Problem Solving and Design


2. Explain what is meant by:
(a) Validation [2]
(b) Verification [2]
3. Study the given flowchart carefully.

START

Count = 1

INPUT
Number

Number = Number DIV 2

Yes
Is Number = 0
OUTPUT Count
?

No
STOP
Count = Count + 1

(a) Draw a trace table to show the output from the flowchart for the following sets of
input:
12, 42, 60, 56, 72, 128 [10]
(b) Explain the purpose of this algorithm. [3]

Page 3 of 3

You might also like