Computer Science · Oct / Nov 2016 · Paper 22 · Question 1
2210
As printed in the paper
Show the answer and mark scheme
1(a)(i)[3]
Many correct answers, they must be meaningful. This is an example only. – Choice, integer, choice of charity – Cost, real, cost of shopping – Donation, real, donation calculated from cost of shopping [3]
1(a)(ii)[3]
– Array – a set of (similar) variables grouped together// description or array declaration applied to the scenario e.g. DonationTotals[1:3] – allows for more efficient programing e.g. use of indices//each charity total can be identified by an index or – List – a set of variables grouped together// description or list declaration applied to the scenario e.g. DonationTotals[] – allows for more efficient programing e.g. use of a loop to update each charity or – Variables – storage locations that can be changed// description or declaration applied to the scenario e.g. DonationTotal1, DonationTotal2 and DonationTotal3 – e.g. as there are only 3 charities so there is no need to use an array [3]
1(b)[5]
Any five from:
– Prompt for input of charity choice // prompt for input of value of shopping – input charity choice – check for input of 1, 2, or 3 – input value of shopping – calculate donation – add donation to the appropriate total – output name of charity and amount/total amount donated [5]
Sample Answer. REPEAT PRINT 'Please enter choice of charity 1, 2. or 3 ' INPUT Choice UNTIL Choice = 1 or Choice = 2 or Choice = 3 PRINT 'Please enter value of shopping bill ' INPUT BillValue Donation BillValue * 0.01 Total (Choice) Total (Choice) + Donation PRINT 'Charity ', CharityName (Choice), ' has received a donation of ', Donation
1(c)[6]
Maximum six marks in total for question part Description (may include reference to program statements) – when charity choice = -1 – display total donation for each charity … – … with corresponding charity name… – description of method for selecting descending order of totals – evidence that the method works – calculate grand total from 3 totals / sum of all donations – output ‘GRAND TOTAL DONATED TO CHARITY’ and grand total [6]
1(d)[3]
Any three from:
– input number of charities – store the number of charities as a variable – change the upper value of the choice input – change the array bounds for total donations etc.// add new variables to hold extra values – the need to change the code… – … to allow for differing number of charities [3]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

