Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
71 views

Programe: Oct/NOV 2005

The document describes several programming tasks and questions: 1. It provides examples of screen layouts and report designs for collecting and displaying data from online surveys. This includes justification for the screen layout designs. 2. It discusses different debugging tools and techniques for identifying and fixing errors in programs, including variable checks, breakpoints, stepping, and variable watches. 3. It provides examples of designing interfaces and reports for managing inventory databases for various businesses, with a focus on layout, controls, and grouping or filtering of displayed data.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Programe: Oct/NOV 2005

The document describes several programming tasks and questions: 1. It provides examples of screen layouts and report designs for collecting and displaying data from online surveys. This includes justification for the screen layout designs. 2. It discusses different debugging tools and techniques for identifying and fixing errors in programs, including variable checks, breakpoints, stepping, and variable watches. 3. It provides examples of designing interfaces and reports for managing inventory databases for various businesses, with a focus on layout, controls, and grouping or filtering of displayed data.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

2.

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]

May/June 2012. P21/22

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:

• student’s first name


• date of birth
• type of book they prefer (printed, audio-book or e-book)
• whether student reads novels (yes/no)

(a) Draw a suitable screen layout. [4]


(b) Justify the design of your screen layout in (a). [3]
(e) Anna will want a report that shows these totals.

Design a printed report that shows for each BookType:

• the total for that type


• the percentage for that type [3]

May/June 2012. P23

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:

• student's first name

• age (16,17,18 or 19)

• favourite sport

• whether student is a member of a sports club (yes/no)

(a) Draw a suitable screen layout. [4]

(b) Justify the design of your screen layout in (a). [3]

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.

The array BikePlace[30,3] stores the bike ID.

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.

Describe how a variable check is used. [2]

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.

Design the layout of the report. [7]

Oct/NOV 2012 P22

2 Super Cars owns a rectangular car park with 25 rows; each row has 4 parking spaces.

Each car is always parked in the same space.

The array ParkingSpace[25,4] stores the car registrations.

Soni uses a flowchart to help him design a module to populate the array with the car registrations.

Input is terminated using the rogue value “00HIRE”.

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.

Design the layout of the report. [6]

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.

Each bike is always parked in the same space.

The array BikeSpace[30,4] stores the bike registrations.

Soni uses a flowchart to help him design a module to populate the array with the bike registrations.

Input is terminated using the rogue value “BK000”.

(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.

Design the layout of the report. [7]

May/June 2013. P21/22

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]

May/June 2013. P23

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

3 (a) An interface is to be designed to add a new resource. The user must:

• enter the name of the resource


• choose the type of the resource
• select the purchase date
The program generates and displays:
• a new resource ID
• where the resource is kept
The user must be able to save the data, clear/cancel the input, and move on to entering another resource.

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.

Design the report layout. [5]

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.

A resource with resource ID MyResource[X] is kept at KeptIn[X], where X is an integer variable.

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

OUTPUT "Not Found"

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.

She wants the log-in screen to display:

• a prompt to enter the password


• space to enter the password
• how many attempts have been made
• if the log-in has been successful or not
• a means of cancelling the log-in process

(a) Draw a suitable layout for the screen.

[5]

Oct/Nov 2013.P23

3 (a) An interface is to be designed to add a new piece of equipment.

The user will:

• enter the name of the equipment


• choose the science subject it will be used in
• if Chemistry, indicate if secure storage is necessary
• select the purchase date

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.

Design the report layout. [5]

May/June 2014. P21/P22

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

• whether the cake is to be delivered or not.

(a) (i) Draw a suitable screen layout for a customer to order a cake online. [4]

(ii) Justify one feature of your design above. [1]

Oct/Nov 2014.P21/P23

1 Rema surveys the students in her class to find out which is the most popular sport.

She draws a tally chart:

Rema plans to collect sport data from students in the whole school. She designs a program to:

• input the number of the sport a student likes best (1, 2, 3 or 4)


• repeatedly ask for input until the input is 0 (zero)
• keep a count of each choice
• on completion of data entry, print out the results as a tally chart (as shown above)

Rema’s first attempt is the following pseudocode:

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

OUTPUT "Cricket ", Cricket

OUTPUT "Football ", Football

OUTPUT "Tennis ", Tennis

OUTPUT "Swimming ", Swimming

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.

List three such features. [3]

(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:

• to enter the length of the room in cm


• to enter the width of the room in cm
• to display the number of tiles required.

(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.

(i) Draw a suitable screen layout.

[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

03 UNTIL ColumnNumberValid( …………………………………………………………………………………………………………)

04 Row ← 1 // start with bottom row and find first empty row

05 WHILE Grid[Row, ChosenColumnNumber] <> ……………………………………………………………………

06 ………………………………………………………………………………………………………………………………………………………………………

07 ENDWHILE

08 IF ……………………………………………………………………………………………………………………………………………………………………

09 THEN

10 Grid[Row, ChosenColumnNumber] ← …………………………………………………………………………

11 ELSE

12 Grid[Row, ChosenColumnNumber] ← …………………………………………………………………………

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

3 A board game is designed for two players, O and X.

At the beginning, all cells of a 3 x 3 grid are empty.

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.

Here is one example after three turns:

Ali wants to write a program to play the game.

(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

IF Numbers[j] > Numbers[j + 1]

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.

(a) Explain how each of the following are used:


(i) Break point [2]
(ii) Stepping [2]
(iii) Variable check/watch [2]
(b) Name the type of testing that is performed with such debugging tools. [1]
Computer Science (9608)
Oct/Nov 2015.P21/P23

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

You might also like