0% found this document useful (0 votes)
1K views

2.1 Algorithm Design and Problem-Solving PDF

The document provides examples of past paper questions related to the topic of algorithm design and problem-solving. The questions cover various concepts including: 1) Validation checks such as ensuring values are within a specified range, data types match expected formats, and verification of input data. 2) Examples of validation checks for fields in databases, forms, and spreadsheets including name, date, numeric ranges, and credit card numbers. 3) The purpose of validation being to ensure accurate and appropriate data is entered into computer systems and databases.

Uploaded by

ekta sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

2.1 Algorithm Design and Problem-Solving PDF

The document provides examples of past paper questions related to the topic of algorithm design and problem-solving. The questions cover various concepts including: 1) Validation checks such as ensuring values are within a specified range, data types match expected formats, and verification of input data. 2) Examples of validation checks for fields in databases, forms, and spreadsheets including name, date, numeric ranges, and credit card numbers. 3) The purpose of validation being to ensure accurate and appropriate data is entered into computer systems and databases.

Uploaded by

ekta sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 97

Computer Science 2210

Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2006

12 A music club keeps its members’ details on a computer file.


(a) Complete the table below which shows the data type, field length and validation checkused
for the club members’ data.

Oct/Nov 2006

1 Explain, using examples where appropriate, the following computer terms:


(a) verification [2]

Oct/Nov 2006
11 A school keeps a spreadsheet of examination results in four subjects. Part of the spreadsheet is
shown below.

(e) State the validation check that should be carried out on data entered in cells C2 to F8 to
ensure values over 100 are not input.

Page 1 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2007

11 (b) Input data needs to go through a validation process.


(i) Explain the term validation.
(ii) Describe one type of validation check.

Oct/Nov 2007

15 A school Science department is going to use a database to record details about its
equipment.
(b) Part of the database is shown below:

(i) As data is entered it needs to be verified. Describe one way this could be done. [1]
(ii) Data also needs to be validated. Using fields from the database as examples,
Describetwodifferent validation checks which could be performed on the data.

May/June 2008
5 Computer systems can be affected by viruses.
(d) Examination results are stored in students’ records as marks out of 100. Give two different
validation checks that could be performed on students’ marks.

6
(d) Examination results are stored in students’ records as marks out of 100. Give two different
validation checks that could be performed on students’ marks. [2]

Page 2 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2008
15 A database has been produced showing solar system statistics.

(d) Name a different validation check for each of the following fields.
(i) Maximum surface temperature (0C)
(ii) Name of planet

Oct/Nov 2009

1 Explain, using examples where appropriate, the meaning of these computer terms.
(e) validation

Page 3 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2010 P11

15 A database has been set up to bring together information about the world’s tallest buildings.
A section of the database is shown below.

(d) For each of the following fields give a different validation check.
Year
Ref No.

Oct/Nov 2010 P11


2 (a) State three reasons why a computer system failure might occur (malfunction). [3]
(b) One effect of a computer system failure is the loss or corruption of files. State one wayof
recovering a file if it has been lost or corrupted. [1]
(c) How is it possible to ensure illegally accessed files are unreadable? [1]

15 A college secretary inputs data into fields on a computer screen as shown below:

(a)Choose a suitable different validation check for each of the following:


(i) Student Sex which can be M or F only
(ii) Today’s Date which must be written as, for example, 15/10/2010
(iii) the Examination Result which can be any number from 0 to 100
(b) Apart from validation, how would it be possible to ensure only certain data could beinput into
each of the fields on the computer screen? [1]

Page 4 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2010 P13

1. Explain, with examples where appropriate, the following five computer terms.
(d) Verification

16 A customer logs on to a secure website using a code and a password. The first stage is tokey in
a code which is his date of birth (DDMMYY) followed by 1234. The second stage isto type in the
first, third, fourth and seventh character of his password.

The customer last logged on to the website on 15th March 2010.


(a) (i) The customer’s date of birth is 15th November 1985. What is the customer’scode?

(ii) Why is this code not unique?


(iii) Suggest how this coding system could be improved. [3]

(b) (i) The customer’s password is PAULO168.


What does the customer need to type at the second stage?

(ii) Why are passwords used? [2]


(c) If the customer gets through the two stages above he is then directed to a new security
page which states:
“You were last logged on to this website on 14th April 2010. Is this correct?”
What could have happened to make the customer concerned about this statement? [1]

May/June 2011 P11

7 A spreadsheet has been set up to compare the costs of types of fruit juice sold by a shop.

Page 5 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


(b) What validation check could be carried out on the data in cells B2 to B6? [1]

May/June 2011 P12

8 A media sales company has set up a website.

The opening page is:

(b) (i) Name a validation check that could be used ontheCustomer ID field? [1]
(ii) Describe TWO types of test data, together withexamples, that could be used to see
whetherthe validation check named in (i) works.

16 A book shop uses barcodes for its computerized stock control.


Each book title has a barcode which identifies it.

The data is stored in a table.


(a) A sample of the data stored in the table is shownbelow:

(i) Which is the key field?


(ii) Give TWO examples of when the data in the table will need to be changed. [3]
(b) Each barcode has a check digit.
(i) Explain how the check digit is used as a validation check.
(ii) What type of error can the check digit identify? [2]

Page 6 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


(c) Name DIFFERENT suitable validation checks for EACH of the following fields:
Book title:,Copies:, Publication date: [3]

Oct/Nov 2011 P13

4 Five definitions and descriptions are shown below on the left hand side.
Five computer terms are shown on the right.
Match the definitions/descriptions on the left to the correct term on the right by drawing
connecting arrows.

Page 7 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2012 P11

10 Jatinder uses Internet banking.


She uses a 5-digit PIN.
(b) Every time she logs on, she is asked to give 3 random digits from the PIN. She wasasked to give
her 3rd, 1st and 4th digit. This changes every time she logs on.
Give a reason for this. [1]
(c) A different application needs the whole PIN to be input.
The following code has been written to check the PIN:

c=0
INPUT PIN
x = PIN
REPEAT
x = x/10
c = c + 1
UNTIL x < 1
IF c < 5
THEN
PRINT “error in PIN entered”
ELSE
PRINT “PIN OK”
ENDIF

(i) What value of c and what message would be output if the following PINs were entered?
5 1 0 2 0 Value of c:
Message:
5 1 2 0 Value of c:
Message: [2]
(ii) What type of validation check is being carried out here? [1]

May/June 2012 P12


9 (b) State two different validation checks and give an example of their use. Each example
should be different.

Page 8 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2013 P11
15 A spreadsheet was set up to allow customers to work out their monthly payments when
borrowing money from a bank. The customer inputs data in column B.
The spreadsheet is as follows:

(e) Give two different validation checks you would use for inputs to cells:
B2
B5

May/June 2013 P12

13 A company requests new customers who register online to give the following details:
• name
• address
• type of credit/debit card
• payment card number
All details must be entered.
(a) (i) Describe one suitable different validation check for each field.
name
address
type of credit/debit card
payment card number

Page 9 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2014 P11 (7010)

3 A hospital holds records of its patients in a database. Four of the fields are:
• date of visit (dd/mm/yyyy)
• patient’s height (m)
• 8-digit patient ID
• contact telephone number
The presence check is one possible type of validation check on the data. For each field,
giveanother validation check that can be performed. Give an example of data which would fail
yournamed validation check.
A different validation check needs to be given for each field.

Field Name Name of validation check Example of data which


would fail the validation
check

Date of visit

Patient’s height

Patient ID

Contact telephone
number

Page 10 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Past Papers Questions: A Levels
May/June 2003
A college stores its student files on paper which is kept in filing cabinets. The decision is taken
tocomputerise these student files.
A systems analyst is employed to supervise the process.
11. The data stored needs to be as accurate as possible. Twice each year examination grades
areentered (A to G) for each subject. Describe how the techniques of
(i) verification,
(ii) validation
are used to ensure that the stored data is as accurate as possible. [6]

Oct/NOV 2004

9. Customers are identified by a 6 digit code. The first three digits are between 000 and 100
fororganisations and between 300 and 600 for individuals. It is important that the 6 digit
customer code is correctly entered to the system.
Describe how
(i) verification
(ii) validation
can help to ensure that as few errors as possible occur. [6]

May/June 2006
A small business has one shop. It specialises in taking portrait photographs for customers.
Details of customers are stored on paper.
It is decided to buy a stand-alone computer and use it to store customer records in a file.
8. Data that is entered into the file needs to be verified and validated.
(a) Explain what is meant by the terms
(i) verification;
(ii) validation. [2]

(b) Describe two methods that can be used for validating the date of the original
commission. [4]

May/June 2007
5. (a) Describe what is meant by verification of data. [2]
(b) Give an example of an application which would require the data input to be
verified andexplain why it would be necessary. [2]

Page 11 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2009
A company specialises in creating websites for customers.
12. The company stores details of customers and their accounts in a database.
The data input to the database must be verified and validated.
One piece of data which will be input to the database is the amount of money when a
customermakes a payment.
(b) (i) State what is meant by verification of data. [1]
(ii) Describe how the customer payment will be verified when it is input to the
database. [2]
The data input to the database must be verified and validated.
One piece of data which will be input to the database is the amount of money when a
customermakes a payment.
(c) (i) State what is meant by validation of data. [1]
(ii) Describe how the customer payment will be validated when it is input to the
database. [2]

Oct/NOV 2009. P12


3. A library stores details of members on the member file.
(b) When a member's name is input to the system it needs to be validated.
(i) State what is meant by validation. [1]
(ii) Describe two validation checks that can be carried out when a member's
name is input to the system. [4]

Page 12 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

May/June 2006 (7010)


9

Trace the flow chart using the numbers 2 and 3. Write down each of the values of N in the
orderthat they are printed out.
(a) 2 [1]
(b) 3 [2]

Page 13 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2006
17 The following flowchart shows how the bar code written on an item is used to find the price,do
stock control and produce an itemised bill. Select statements from the list below tocomplete the
flowchart.

Page 14 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2007

2 Describe, with examples, two types of test data which could be used to test a system. [4]

11 Study the following flowchart very carefully.

(a) Complete the following table showing the expected output from the flowchart for the three
sets of input data:

Page 15 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2007
11Majid lives in Cairo but often travels to Tokyo, Mumbai and Washington. A flow chart hasbeen
written so he can work out the local time in these three places.

Page 16 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 17 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2008
9 The following flowchart inputs two numbers, carries out a calculation and then outputs theresult.

(a)Complete the following table for the three sets of input data.

Page 18 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2008
17 The following flowchart shows how sensors (which can be analogue or digital) and a computer
are used to control the temperature of a greenhouse for plants. Complete the flowchart using the
items from the list below.

Page 19 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2009
14 Study the flowchart very carefully.

(a) Complete the table to show what outputs you would expect for the two inputs.

Page 20 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


16 The following flowchart shows what happens when a customer uses a credit card to pay
forgoods at a supermarket. Ten of the boxes are blank.
Using the items from the list, insert the ten missing statements using the appropriatenumber only.
Each statement may be used once only.

Page 21 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2009. P11
9 Study the flowchart.

Page 22 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2010. P12
13 Study the following flowchart very carefully:

Page 23 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2010. P11
4 (a)To log on to a computer, a user needs to type in a user id followed by a password;these
should match up. Only three attempts are allowed.

The flowchart below shows the log on procedure. Several boxes have been left blank.
Complete the flowchart using items from the list.

Page 24 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2010. P13
15 (a) The following flowchart shows how a burglar alarm system uses light sensors todetermine if
an intruder has entered the house and decides to sound an alarm.
Select statements from the list below, using numbers only, to complete the flowchart.

Page 25 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2011. P11
5 Study the following flowchart very carefully:

Page 26 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

(b) What is the purpose of this flowchart? [1]

Page 27 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2011. P12
10 The following flowchart inputs ten temperatures andoutputs the average (mean) temperature
and thenumber of temperatures which were negative (i.e. < 0).

Page 28 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 29 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2011. P11

Page 30 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 31 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 32 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2011. P13

Page 33 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 34 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 35 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2012. P11

Page 36 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 37 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 38 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 39 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2012. P12

Page 40 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 41 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2012. P12

Page 42 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 43 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 44 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 45 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2012. P13

Page 46 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 47 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 48 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 49 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2013. P11

Page 50 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 51 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2013. P12

Page 52 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 53 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 54 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2013. P12

Page 55 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Oct/Nov 2013. P12

5 Study the following flowchart


very carefully

Page 56 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Complete the trace table for the following two sets of data:
(i) a = 5, b = 4, c = 1, d = 9
(ii) a = 5, b = 9, c = 4, d = 1

Page 57 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


15 A library uses barcodes to identify borrowers and books. A borrower has a card
containinga barcode with an equivalent numerical code. Each book also has a barcode
with anequivalent numerical code.
The flowchart on the facing page shows what happens when book(s) are taken out by
aborrower. However, several stages are missing.
Using item numbers only, complete the flowchart by selecting stages from the item
listbelow.

Page 58 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 59 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2013. P13

14 A microprocessor controls the opening and closing of automatic doors to a


supermarket.Customers are detected using pressure sensors.
The flowchart on the next page shows how the sensors and microprocessor interact tocontrol the
opening and closing of the doors. However, several of the stages in the processhave been missed
out.
Using item number only, complete the flowchart using items from the following list:

Page 60 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 61 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2014. P11
8 Study the following flowchart very carefully.

Page 62 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Complete the trace table for the input value of 5:

13 A heating system is being controlled by sensors and a computer. The temperature must be
keptbetween 15°C and 25°C. If 30°C is exceeded a warning message is generated and the
systemshuts down.
A flowchart of the process is shown below. Some of the items are missing.
Complete the flowchart, using item number only, from the list of items given.

Page 63 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 64 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2014. P12

10 Study the following flowchart very carefully.

Page 65 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Complete the trace table for the flowchart using the following data:
0, 3, 5, 6, -4, -1, 0, 0, -4, 10

Page 66 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


13 An algorithm has been written to check that code numbers are valid on input. They must be in
therange 1000 to 9999.
Five hundred codes are being entered and the percentage of entered codes which are
incorrectis output.
There is a flowchart on the opposite page. It has some statements missing.
Complete the flowchart. Use statement numbers only, chosen from the list below.

Page 67 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 68 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2015 P21 (2210)

Page 69 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 70 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2015 P22 (2210)

Page 71 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Page 72 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2016 P21 (2210)

1 (b) Write an algorithm to complete Task 1, using either pseudocode, programming statements
or a flowchart. [5]

(c) Give three different data sets that could be used to check your validation rules for Task 1.
Explain why you chose each data set. [6]
(d) Explain how your program calculates the price for a consignment (part of Task 3). You may

Page 73 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


include programming statements as part of your explanation. [4]

2 Read this section of program code that inputs 10 positive numbers and then outputs the smallest
number input.
1 Small = 1000
2 Counter = 0
3 REPEAT
4 INPUT Num
5 IF Num < Small THEN Small = Num
6 Counter = Counter + 1
7 UNTIL Counter = 10
8 PRINT Small
(i) Identify three changes you would need to make to find the largest number input instead
of the smallest number. [3]
(ii) Rewrite the program code with your changes. [3]

4 The flowchart below inputs the height of children who want to ride on a rollercoaster. Children
under 1.2 metres are rejected. The ride starts when eight children have been accepted.

Complete the trace table for the input data:


1.4, 1.3, 1.1, 1.3, 1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0

Page 74 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

[4]

5 REPEAT ... UNTIL is one type of loop structure.


Identify and describe two other types of loop structure that you could use when writing
pseudocode. [4]

Page 75 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2016 P22 (2210)

1 (b) Write an algorithm to complete Task 2, using either pseudocode, programming statements
or a flowchart. You can assume that the weight and contents have already been checked and

Page 76 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


accepted in Task 1. You do not need to output the number of sacks rejected. [6]

(c) (i) Give two different data values that could be used to check your validation rules for sand
in Task 1. Explain why you chose each value. [2]
(ii) Give two different data values that could be used to check your validation rules for
cement in Task 1. Explain why you chose each value. [2]
(d) Explain how your program calculates the price for an order (Task 3). You may include
programming statements as part of your explanation. [5]

2 Read this section of program code that inputs 10 positive numbers and then outputs the total.
1 Total = 0
2 Counter = 0
3 REPEAT
4 INPUT Num
5 Total = Total + Num
6 PRINT Total
7 Counter = Counter + 1
8 UNTIL Counter = 10
This code works, but it is inefficient.
(i) Suggest three improvements that could be made. [3]
(ii) Rewrite the program code with your improvements. [3]

3 The flowchart below calculates the number of tins of paint required to paint walls. The flowchart
inputs the height and width of a wall in metres, the number of doors and the number of windows.
A value of –1 for the height stops the input.

Page 77 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Complete the trace table for the input data:
3, 5, 1, 0, 3, 7, 0, 0, 3, 5, 0, 3, 3, 7, 1, 1, –1, 0, 0, 0

[4]

Page 78 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Oct/Nov 2015 P23 (2210)

1 (a) All variables, constants and other identifiers should have meaningful names.
(i) When you performed the tasks, you used variables.
Write suitable declarations for two of these.
State what you used each one for. [4]

(ii) When you performed the tasks, you may have used constants.
Write suitable declarations for two of these.
State what you used each one for.
[4]

(b) Write an algorithm to complete Task 2, using either pseudocode, programming statements
or a flowchart. You should assume that the temperatures taken over the five hours are already
stored in an array. [5]

Page 79 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


(c) (i) Explain how you completed Task 3. You should assume that Task 2 has been completed.
You can include pseudocode or programming statements as part of your explanation. [6]

(ii) Comment on the efficiency of your design for Task 3. [1]

2 Read this section of program code that should input 50 numbers and then output the average
of
the positive numbers only.

There are four errors in this code.


Locate these errors and suggest code corrections to remove each error. [4]

Page 80 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


3 (a)

[4]

Page 81 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

(b) State the purpose of the pseudocode in part (a). [2]

4 A routine checks the age and height of children who are allowed to enter a play area. The
children
must be less than 5 years of age and under 1 metre in height.
(a) The first set of test data used is age 3 and height 0.82 metres.
State what type of test data this is.
Give a reason for using this test data.
[2]
(b) Provide two additional sets of test data. For each, give
• the type of each set of test data
• the reason why it is used
Each type of test data and reason for use must be different.
[6]

5 A motor boat hire company decides to set up a database to keep information about boats that
are
available for hire. The database table, BOAT, will contain the following fields:
Boat Name; Model; Engine Power (in hp); Number of Seats; Life Raft (whether there is a life raft
kept on the boat); Day Price (price for a day’s hire).
(a) Give the data type you would choose for each field. [3]

Page 82 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2016 P22 (2210)

1 (a) All variables, constants and other identifiers should have meaningful names.
(i) For three of the variables that you have used in Task 1, state the name, type and its use. [3]

(ii) Name and describe the data structure(s) that you have used to store the donation totals
for each charity. Explain why you chose your data structure(s). [3]

Page 83 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


2 Read this section of program code that inputs positive numbers, discards any negative numbers
and then outputs the average. An input of zero ends the process.

There are four errors in this code.


Locate these errors and suggest a correction to remove each error. [8]

3 The flowchart below inputs an integer. The predefined function DIV gives the value of the
division,
for example Z ← 11 DIV 3 gives the value Z = 3. The predefined function MOD gives the value
of the remainder, for example Z ← 11 MOD 3 gives the value Z = 2.

Page 84 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Complete a trace table for each of the two input values 33 and 75.
Trace table for input value 33

Trace table for input value 75

[4]

4 IF ... THEN ... ELSE ... ENDIF and CASE ... OF ... OTHERWISE ... ENDCASE
are two different conditional statements that you can use when writing pseudocode.

Explain, using examples, why you would choose to use each conditional statement. [6]

Page 85 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2016 P23 (2210)

1 (a) All variables, constants and other identifiers should have meaningful names.
For four of the variables, constants or arrays that you used in Task 1, state the name, data
structure, data type and its use. [8]

Page 86 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


2 Read this section of program code that:
• inputs 10 numbers
• checks whether each number is within a specified range
• totals the numbers within the range and outside the range

(a) There are four errors in this code.


Locate these errors and suggest a correction to remove each error. [4]

(b) Decide, with reasons, whether the numbers 10 and 20 are within or outside the range.

[4]

3 The flowchart below inputs the price of an item under $10. The change from a $10 note is
output.
Any amount less than 5 cents is rounded up to 5 cents.
The predefined function INT rounds a number down to the nearest whole number; for example
Z ← INT(5.7) gives the value Z = 5

Page 87 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

Complete the trace table for the input data: 6.29

Page 88 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving

[5]

4 Four validation checks and four descriptions are shown below.


Draw a line to link each validation check to the correct description.

[3]

5 REPEAT ... UNTIL and WHILE ... DO ... ENDWHILE are two different loop
structures you can use when writing pseudocode.
Explain, using examples, why you would choose to use each type of loop. [6]

Page 89 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Oct/Nov 2017 P22 (2210)

1 (b) Give two different validation checks you could have used for data entry in Task 1. For each
check explain why it could be used and provide a set of data for testing. [6]
(c) Write an algorithm to complete Task 3, using either pseudocode, programming statements
or a flowchart. You may assume Task 2 has been completed. [5]
(d) Explain how your program finds out how many boats are available for hire (Task 2).
Any programming statements used must be fully explained. [4]
2 Write an algorithm using either pseudocode or a flowchart, to:
• input a positive integer
• use this value to set up how many other numbers are to be input
• input these numbers
• calculate and output the total and the average of these numbers. [6]

4 IF … THEN … ELSE … ENDIF is one type of conditional statement used when writing
pseudocode.
Identify and describe another type of conditional statement that you could use when writing
pseudocode. Give a reason why you would use this type of conditional statement. [4]

Page 90 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


5 (a) This flowchart checks a batch of 10 rice sacks for weight. Sacks should weigh 50 kilograms
each. Sacks weighing over 50.5 kilograms or less than 49.5 kilograms are rejected. The number of
sacks accepted and the number of sacks rejected is output.

Complete the trace table for the input data:


50.4, 50.3, 49.1, 50.3, 50.0, 49.5, 50.2, 50.3, 50.5, 50.6

[5]

Page 91 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


(b) The size of the batch has increased to 50 sacks. It has been decided to only reject sacks that
are underweight.
State the changes that need to be made to the flowchart. [2]
Oct/Nov 2017 P23 (2210)

Page 92 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


1 (b) Write an algorithm to complete Task 1, using either pseudocode, programming statements
or a flowchart. [5]
(c) Describe how you could validate and test the inputs for Task 1. [4]
(d) Explain how your program checks and displays whether any of the planes are available at a
given time of the day (Task 2). Any programming statements used must be fully explained. [4]

2 This section of program code asks for 80 numbers between 100 and 1000 to be entered. It
checks that the numbers are in the correct range, and stores them in an array. It counts how
many of the numbers are larger than 500 and then outputs the result when the program is finished.
1 Count = 0
2 FOR Index = 1 TO 80
3 INPUT 'Enter a number between 100 and 1000', Number
4 WHILE Number = 99 AND Number = 1001
5 INPUT 'This is incorrect, please try again', Number
6 ENDWHILE
7 Num[80] = Number
8 IF Number > 500 THEN Count = Count + 1
9 UNTIL Index = 80
10 PRINT Index
11 PRINT ' numbers were larger than 500'
There are four lines of code that contain errors.
State the line number for each error and write the correct code for that line. [4]

3 (a) Explain the difference between a validation check and a verification check. [2]
(b) Describe, using an example, how data could be verified on data entry. [2]
(c) Explain what is meant by the term library routine. [2]

Page 93 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


May/June 2018 P23 (2210)

1 (b) Explain how your program for Task 1 ensures that each 3-digit identity code is unique. [2]
(c) Write an algorithm for Task 2, using either pseudocode, programming statements or a
flowchart.
Assume that Task 1 has been completed. [5]
(d) (i) Explain how your program for Task 3 finds the cows with a daily yield of less than 12 litres of
milk for four days or more in the week. Any programming statements used in your answer must be
fully explained. [5]
Page 94 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


(ii) Explain how you would extend your program for Task 3 to store the identity code number(s) of
those cows with a yield of less than 12 litres of milk for four days or more in the week. [2]

2 (a) Draw a flowchart for an algorithm to input numbers. Reject any numbers that are negative
and count how many numbers are positive. When the number zero is input, the process ends and
the count of positive numbers is output.
(b) Explain the changes you will make to your algorithm to also count the negative numbers. [2]

3 This pseudocode algorithm inputs two non-zero numbers and a sign, and then performs the
calculation shown by the sign. An input of zero for the first number terminates the process.
INPUT Number1, Number2, Sign
WHILE Number1 <> 0
IF Sign = '+' THEN Answer Number1 + Number2 ENDIF
IF Sign = '-' THEN Answer Number1 - Number2 ENDIF
IF Sign = '*' THEN Answer Number1 * Number2 ENDIF
IF Sign = '/' THEN Answer Number1 / Number2 ENDIF
IF Sign <> '/' AND Sign <> '*' AND Sign <> '-' AND Sign <> '+'
THEN Answer 0
ENDIF
IF Answer <> 0 THEN OUTPUT Answer ENDIF
INPUT Number1, Number2, Sign
ENDWHILE
(a) Complete the trace table for the input data:
5, 7, +, 6, 2, –, 4, 3, *, 7, 8, ?, 0, 0, /

[3]
(b) Show how you could improve the algorithm written in pseudocode by writing an alternative
type of conditional statement in pseudocode. [3]

4 A programmer has written a routine to store the name, email address and password of a
contributor to a website’s discussion group.
(a) The programmer has chosen to verify the name, email address and password.
Explain why verification was chosen and describe how the programmer would verify this data. [4]
(b) The programmer has also decided to validate the email address and the password.
Describe validation checks that could be used. [2]

5 A program checks that the weight of a basket of fruit is over 1.00 kilograms and under
1.10 kilograms. Weights are recorded to an accuracy of two decimal places and any weight not
in this form has already been rejected.

Page 95 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


Give three weights as test data and for each weight state a reason for choosing it. All your reasons
must be different. [3]

May/June 2018 P21 (2210)

(b) Explain how your program for Task 1 produces a unique estimate number. [2]
(c) Write an algorithm for part of Task 2 to check that the chosen processor and chosen RAM are
in stock, using either pseudocode, programming statements or a flowchart. Assume that Task 1
has been completed. Do not check the other components or produce the order. [5]
(d) Explain how your program completes Task 3. Any programming statements used in your
answer must be fully explained. [5]

Page 96 of 97
Computer Science 2210
Topical Past Papers

Topic: 2.1 Algorithm design and problem-solving


2 (a) Write an algorithm to input 1000 numbers. Count how many numbers are positive and how
many numbers are zero. Then output the results. Use either pseudocode or a flowchart. [6]
(b) Give one change you could make to your algorithm to ensure initial testing is more
manageable. [1]
3 The global trade item number (GTIN-8) barcode has seven digits and a check digit.
This pseudocode algorithm inputs seven digits and calculates the eighth digit, then outputs the
GTIN-8.
DIV(X,Y), finds the number of divides in division for example DIV(23,10) is 2.
MOD(X,Y), finds the remainder in division for example MOD(23,10) is 3.
FOR Count <- 1 TO 7
INPUT Number
Digit(Count) <- Number
NEXT
Sum <- (Digit(1)+Digit(3)+Digit(5)+Digit(7))*3+Digit(2)+Digit(4)+Digit(6)
IF MOD(Sum,10) <> 0
THEN Digit(8) <- DIV(Sum,10)*10 + 10 - Sum
ELSE Digit(8) <- 0
ENDIF
OUTPUT "GTIN-8"
FOR Count <- 1 TO 8
OUTPUT Digit(Count)
NEXT
(a) Complete the trace table for the input data: 5, 7, 0, 1, 2, 3, 4

Complete the trace table for the input data: 4, 3, 1, 0, 2, 3, 1

[5]

(b) Explain how you would change the algorithm to input eight digits (seven digits and the check
digit) and output if the check digit entered is correct or not. [3]
4 A programmer has written a routine to check that prices are below $10.00. These values are
used as test data.
10.00 9.99 ten
Explain why each value was chosen. [3]

Page 97 of 97

You might also like