Scottish Qualifications Authority
7
Coursework Task C206/11
Intermediate 2 Computing
2008/2009
Coursework Task
Intermediate 2 Computing Coursework Task 2008-2009
Part 1
The manager of a school cafeteria wants to use a computer system to calculate how much each
customer has to pay. Members of staff have to pay VAT on their purchases but pupils do not. If the
customer is a member of staff then the program will calculate the VAT and add it to the total cost.
VAT is calculated using the formula:
VAT = 0.175 ! total cost
The system requires the following inputs:
• How many items the customer has to pay for
• The price of each item in pounds
• Whether the customer is a pupil or a member of staff (P for pupil and S for staff)
The output from the program should display the total cost of purchases, the type of customer, the
amount of VAT to be paid and the final cost eg
Total cost of purchases:
2.38
Type of customer:
S
VAT:
0.42
Final Cost:
2.80
Your task is to create software for this system.
Scottish Qualifications Authority
8
Coursework Task C206/11
Intermediate 2 Computing
2008/2009
The top level algorithm is shown below. Step 2 has been refined.
Pseudocode
MAIN STEPS
1.
2.
3.
4.
5.
6.
Get number of items being purchased
Calculate total cost of purchases
Get valid type of customer
Calculate VAT to two decimal places
Calculate final cost
Display purchase details
REFINEMENTS
2.
2.1
2.2
2.3
2.4
2.5
Calculate total cost of purchases
Total cost = 0
Loop for number of items being purchased
Get item price
Update Total cost
Next item
Scottish Qualifications Authority
9
Coursework Task C206/11
Intermediate 2 Computing
2008/2009
Tasks
Evidence required
1
Refine the following parts of the algorithm:
• Get valid type of customer (step 3)
• Calculate VAT to two decimal places (step 4)
• Calculate final cost (step 5)
(NOTE: all refinements must include an algorithm and not simply
use a feature of a