Programe: Oct/NOV 2005
Programe: Oct/NOV 2005
Programe
Oct/NOV 2005
4. (a) When software is written, the code will probably contain errors.
Describe three methods or tools available for identifying program errors. [6]
1 Anna wants to find out about her fellow students’ reading habits. It will be part of her Literature coursework.
She will ask questions online, so starts by designing a screen layout. The first four questions will ask for:
1 Anna wants to find out about her fellow students' sporting activities. It will be part of her Sports Studies
coursework.
She will ask questions online, so starts by designing a screen layout. The first four questions will ask for:
• favourite sport
Page 1 of 16
Oct/NOV 2012 P21
2 The company stores the bikes in bike racks. The bike racks are in 30 rows, each with 3 places. Each bike is always
kept in the same place.
Soni uses a flowchart to help him design a module to populate the array with bike IDs.
(d) There are a number of debugging tools associated with high-level languages.
Page 2 of 16
3 Super Bikes will need a report each month that shows how many times the 5 most used bikes have been hired that
month, the income each generated and any repairs needed.
2 Super Cars owns a rectangular car park with 25 rows; each row has 4 parking spaces.
Soni uses a flowchart to help him design a module to populate the array with the car registrations.
Page 3 of 16
(d) There are a number of debugging tools associated with high-level languages.
Describe how breakpoints and stepping can be used when developing a program. [4]
4 Super Cars will need a printed report that shows how many times the top 10 cars have been hired in a given
month, and the income that each generated.
Page 4 of 16
Oct/NOV 2012 P23
2 Super Bikes owns a rectangular parking area with 30 rows; each row has 4 bike spaces.
Soni uses a flowchart to help him design a module to populate the array with the bike registrations.
(d) There are a number of debugging tools associated with high-level languages.
Describe how breakpoints and a variable watch can be used when developing a program. [4]
Page 5 of 16
3 Super Bikes will need a printed report that shows all the hires made in a given month, grouped by insurance rating
(A, B or C) and the income each hire generated. The report should include the total income figure for each insurance
group.
4 (a) Meena invites her friends to use her program. When designing the user interface.
State three design features she can incorporate when one of her friends has a sight impairment. [3]
4 (a) Meena hopes some of her friends will use her program. When designing the user interface, state three design
features she can incorporate if one of her friends has a sight impairment. [3]
(b) Design the interface. It must allow for entry of marks and the output of the
average mark. Remember, one of her friends has a sight impairment. [6]
Oct/Nov 2013.P21
Design a graphical user interface (GUI). Pay particular attention to layout and effective use of the controls you would
expect to find in a GUI.
Page 6 of 16
[6]
(b) A report will show all the items that have been entered on a particular day.
It will show each resource ID and where the resource is kept. The resources will be grouped by type.
Oct/Nov 2013.P21
3 An array, MyResource, size 5000, data type INTEGER, is used to store the resource IDs.
An array, KeptIn, size 5000, data type STRING, is used to store where a resource is kept.
Page 7 of 16
Juan writes the pseudocode that searches MyResource for a given resource ID and outputs where the resource is
kept.
flag ← 0
INPUT P
FOR X ← 1 TO 5000
IF myresource[X] = P
THEN
OUTPUT keptin[X]
flag ← 1
ENDIF
NEXT
IF flag = 0
THEN
ENDIF
(e) (ii) Juan has written his program and one module appears not to work.
Explain how Juan can use a break point and stepping to debug his program. [3]
Page 8 of 16
Oct/Nov 2013.P22
3 Aisha wants to write a program that checks the password to her personal computer. The program should check
each attempt to enter the password correctly and should terminate after three wrong attempts.
[5]
Oct/Nov 2013.P23
Page 9 of 16
The program generates and displays:
• a new equipment ID
• where the equipment is to be kept
The user must be able to save the data, clear/cancel the input, and move on to entering another piece of equipment.
Design a graphical user interface (GUI). Pay particular attention to layout and effective use of the controls you would
expect to find in a GUI.
[8]
(b) A report will show all the items that have been entered on a particular day.
It will show each equipment ID and where the equipment is kept. Equipment for the same science subject will be
grouped together.
1 A teacher wants to write a program to help young children learn their multiplication tables.
(a) (i) Draw a suitable layout for the initial screen to let a child choose which multiplication table between 1 and 10
they want to learn. [3]
(ii) Explain how the child can choose a number using your screen design in part (a)(i). [1]
Page 10 of 16
May/June 2014.P23
2 Sheena wants to set up a business selling home-made cakes. She wants customers to order online. She needs to
know:
• customer’s name
• customer’s contact telephone number
• the date the cake is to be ready
• the type of cake
o fruit cake
o victoria sponge
o gateau
o cheesecake
(a) (i) Draw a suitable screen layout for a customer to order a cake online. [4]
Oct/Nov 2014.P21/P23
1 Rema surveys the students in her class to find out which is the most popular sport.
Rema plans to collect sport data from students in the whole school. She designs a program to:
Page 11 of 16
Cricket ← 0
Football ← 0
Tennis ← 0
Swimming ← 0
REPEAT
INPUT Choice
CASE Choice OF
1: Cricket ← Cricket + 1
2: Football ← Football + 1
3: Tennis ← Tennis + 1
4: Swimming ← Swimming + 1
ENDCASE
UNTIL Choice = 0
Her friend Aisha suggests that the pseudocode could be improved by:
• using a one-dimensional array, Tally, instead of four variables to store the counts
• modularising the design. The main program should just consist of three procedure calls:
InitialiseArrayCounts
InputStudentChoices
OutputTallyChart
(e) (i) All programs should be maintainable. Rema has followed good practice in writing her pseudocode. She used
some features of maintainable programs.
(ii) Give one further feature that Rema has not used in her solution so far. [1]
Page 12 of 16
3 Ahmed runs his own business. He lays floor tiles in rooms for customers. Ahmed wants a program that calculates
how many tiles he needs when he inputs the measurements of the length and width of the room he is working on.
(a) (i) Draw a screen design that is suitable for the following:
(ii) Explain how Ahmed can enter the data using your screen design in part (i). [1]
Oct/Nov 2014.P22
1 A sports club in a town organises an annual sports day for competitors aged 8 to 18. The organiser wants these
competitors to enter the sports day events online.
(a) To enter an event, each competitor needs to supply the following information:
• Competitor name
• Age in years
• Whether or not they are a sports club member
• The letter code for the single event they want to enter:
A 50 m race
B 100 m race
C Long jump
D High jump
E 5 km cycle race
F 25 m swimming
The competitor confirms that their details are correct. Their computer calculates and displays the entry fee. Entries
are free for sports club members.
[6]
Page 13 of 16
(ii) Justify the design of your screen layout in part (i). [2]
Oct/Nov 2014.P22
3 A game is played by two players. Player A uses white tokens ( ). Player B uses black tokens ( ). The players
take turns dropping tokens into a vertical grid. The tokens fall straight down and occupy the next available space in
the chosen column. The aim of the game is to connect four of one’s own colour tokens. This must be done in a
vertical, horizontal or diagonal line.
Here is one example after Player A has had 2 turns and Player B has had 1 turn:
Nathan wants to write a program to allow two users to play the game on the computer.
The program will display a simplified version of the above grid which is redrawn after every turn.
(d) 01 REPEAT
02 INPUT ChosenColumnNumber
04 Row ← 1 // start with bottom row and find first empty row
06 ………………………………………………………………………………………………………………………………………………………………………
07 ENDWHILE
08 IF ……………………………………………………………………………………………………………………………………………………………………
09 THEN
11 ELSE
13 ENDIF
Page 14 of 16
(f) All programs should be maintainable.
List three features of maintainable programs used in the pseudocode in part (d). [3]
May/June 2015.P21/P22
The players take turns in placing their marker in an empty cell of the grid; player O always starts.
The game ends when one player completes a row, column or diagonal or the grid is full.
(g) Design a suitable form-based screen interface for the current player to input the row number and column
number to place their marker when it is their turn. [4]
May/June 2015.P23
3 (a) Meena has written the algorithm below and wants to check that it works correctly.
FOR i ← 1 TO 4
FOR j ← 1 TO 4
THEN
w ← Numbers[j]
Numbers[j] ← Numbers[j + 1]
Numbers[j + 1] ← w
ENDIF
ENDFOR
ENDFOR
(b) Meena has written the algorithm with some features that make it easier to understand.
Page 15 of 16
(i) State one such feature. [1]
(ii) State one other feature that Meena could introduce to this algorithm to make it easier to understand. [1]
Oct/Nov 2015.P21/P23
3 Ravi and Alia want to use debugging tools available in their program development environments.
(a) Explain how each of the following are used:
(i) Breakpoint [2]
(ii) Stepping [2]
(iii) Variable check / watch [2]
(b) Name the type of testing that is performed with such debugging tools. [1]
Oct/Nov 2015.P22
3 Sheena wants to use debugging tools available in her program development environment.
2 A programmer uses an Integrated Development Environment (IDE) for all program development.
(i) Describe what is meant by an IDE. [2]
(ii) Name three features you would expect to be available in an IDE to help initial error detection or debugging.
[3]
8 In this question you will need to use the given pseudocode built-in function:
(d) The programmer writes code from the given pseudocode design. The program works, but the
design is limited.
The programmer is to make amendments to the design following suggested specification
changes.
(i) State the name for this type of maintenance. [1]
(ii) Describe three specification changes which will make the program more useful. [3]
Page 16 of 16