SlideShare a Scribd company logo
1 of 8
Download to read offline
CAMBRIDGE INTERNATIONAL EXAMINATIONS
General Certificate of Education
Advanced Subsidiary Level and Advanced Level
COMPUTING 9691/02
Paper 2: Practical Tasks
May/June 2004
READ THESE INSTRUCTIONS FIRST
Write your Centre number, candidate number and name on all the work you hand in.
Write in dark blue or black pen on both sides of the paper.
Do not use staples, paper clips, highlighters, glue or correction fluid.
Answer all questions.
The number of marks is given in brackets [ ] at the end of each question or part question.
This document consists of 5 printed pages and 3 blank pages.
Ó CIE 2004 [Turn over
2
9691/2/M/J/04
Answer all questions.
Task 1 [29 marks]
This is a software development task and an implementation task.
An English department in a college expects students to read a number of books which the
Department keeps in its library. The Department wishes to keep details of books borrowed by
students to ensure that the students read the books set by the tutors. A student borrows many books
and a book is borrowed by many students.
A database consisting of the tables Student, Book and StudentBook is to be created. The
StudentBook table is used to link the other two tables and has the following attributes (fields), each
with the specified data type.
Attribute (field) Data Type
StudentID Numeric type
BookID Numeric type
Date Borrowed Date type
The key is a compound key formed from StudentID and BookID.
(a) Create a table called Student to hold details of all the students.
(i) Describe the
· purpose of each attribute,
· data type of each attribute. [6]
(ii) Identify the key. [1]
(b) Create a table called Book to hold the details of the books.
(i) Describe the
· purpose of each attribute,
· data type of each attribute. [8]
(ii) Identify the key. [1]
(c) Create data for the three tables. You should have at least 20 students and 15 books. The
data should be suitable for testing the tables. Include a print-out of your tables in your
documentation. [7]
(d) Create an interface that allows a user to input a book's ID and prints a report showing a list of
the students who have borrowed that book and the dates on which each student borrowed
the book. Provide hard copy evidence that the report is produced. [3]
(e) Create an interface that allows a user to input a student's ID and prints a report showing a list
of the books the student has borrowed and the dates on which each book was borrowed.
Provide hard copy evidence that the report is produced. [3]
3
9691/2/M/J/04 [Turn over
Task 2 [10 Marks]
This is an algorithm trace task. No implementation is required.
L, R and Data are one-dimensional arrays, each with 5 elements numbered from 1 to 5. The contents
of the three arrays are shown in Fig. 2.1.
Index L Index R Index Data
1 2 1 3 1 DOG
2 0 2 4 2 BEAR
3 5 3 0 3 HORSE
4 0 4 0 4 CAT
5 0 5 0 5 GIRAFFE
Fig. 2.1
In these arrays, L(3) contains the number 5, R(2) contains the number 4 and Data(1) contains the
data DOG.
Read the following algorithm.
T = 0
P = 1
REPEAT
WHILE P <> 0 DO
T = T + 1
S(T) = P
P = L(P)
END WHILE
IF T > 0 THEN
Finished = FALSE
P = S(T)
T = T – 1
OUTPUT Data(P)
P = R(P)
ELSE
Finished = TRUE
END IF
UNTIL Finished
EXIT
Task 2 is continued on page 4 overleaf.
4
9691/2/M/J/04
Complete the trace table shown in Fig. 2.2. It is only necessary to enter values in the table when they
change. You should work from left to right and top to bottom. The first six lines are completed for
you.
T P S(1) S(2) Finished Output
0 1
1 1
2
2 2
0 FALSE
2
Fig 2.2
[10]
5
9691/2/M/J/04
Task 3 [21 Marks]
This is a software development task and an implementation task.
Roman numerals are still used for certain limited purposes such as copyright dates. The symbols
used are I =1, V = 5, X = 10, L = 50, C = 100, D = 500 and M =1000.
One definition of Roman numbers is
· the letters must be in descending order of value,
· the value of the number is the sum of all the letters,
· each letter must be used a minimum number of times.
This is known as the additive rule and is the only rule to be used in this question.
For example
MCX = 1000 + 100 + 10 = 1110;
MXC is invalid because of wrong order;
IIII = 1 + 1 + 1 + 1 =4;
IIIII is invalid because it can be replaced with V.
A manufacturer wishes to make a new calculator that allows a user to input a number using Roman
numerals and displays the number in both Roman and Arabic forms.
The calculator must
· allow a user to enter the Roman numerals up to a value of 7000 (MMMMMMM),
· prevent the user entering an invalid numeral,
· display the number entered using Roman numerals,
· update this display as each Roman numeral is entered,
· display the number entered using Arabic numerals,
· update this display as each Roman numeral is entered,
· allow the user to clear both displays, the Roman number and the Arabic number.
The manufacturer wishes to use a simulation of this calculator so that the user interface can be
tested.
(a) Design a user interface that can be used to test the above facilities. Provide hard copy
showing this design. (A screen dump is acceptable.) [5]
(b) Using a high-level language of your choice, implement and test your design to show that all
the above facilities work correctly.
(i) Provide hard copy of your annotated program, stating the language and version used. [5]
(ii) Provide a table showing your test data and the expected and actual results. [6]
(iii) Supply hard copy evidence of testing your solution. (Screen dumps are acceptable, but
must show the data entered and the results.) [5]
6
9691/2/M/J/04
BLANK PAGE
7
9691/2/M/J/04
BLANK PAGE
8
9691/2/M/J/04
BLANK PAGE

More Related Content

What's hot

Estimating Products Lesson 2.5
Estimating Products Lesson 2.5Estimating Products Lesson 2.5
Estimating Products Lesson 2.5
angiebski4
 
Estimating Products
Estimating ProductsEstimating Products
Estimating Products
angiebski4
 
Dm week01 linreg.handout
Dm week01 linreg.handoutDm week01 linreg.handout
Dm week01 linreg.handout
okeee
 

What's hot (15)

Estimating Products Lesson 2.5
Estimating Products Lesson 2.5Estimating Products Lesson 2.5
Estimating Products Lesson 2.5
 
Decimal adder
Decimal adderDecimal adder
Decimal adder
 
Estimating Products
Estimating ProductsEstimating Products
Estimating Products
 
computer arithmatic
computer arithmaticcomputer arithmatic
computer arithmatic
 
Dm week01 linreg.handout
Dm week01 linreg.handoutDm week01 linreg.handout
Dm week01 linreg.handout
 
Microsoft Excel
Microsoft ExcelMicrosoft Excel
Microsoft Excel
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solution
 
More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)
 
Bsc math previous exam quetions
Bsc math previous exam quetionsBsc math previous exam quetions
Bsc math previous exam quetions
 
For ICT - PPT
For ICT - PPTFor ICT - PPT
For ICT - PPT
 
C programming Tutorial Session 3
C programming Tutorial Session 3C programming Tutorial Session 3
C programming Tutorial Session 3
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
 

Similar to Computing Paper 2 Practical Tests may june 2004 general certificate of education gce advanced level cambridge computers zimsec

June 04 P32
June 04 P32June 04 P32
June 04 P32
Samimvez
 
June 05 P2
June 05 P2June 05 P2
June 05 P2
Samimvez
 
Spreadsheets 101
Spreadsheets 101Spreadsheets 101
Spreadsheets 101
whita1bd
 
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docxQuestion 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
IRESH3
 

Similar to Computing Paper 2 Practical Tests may june 2004 general certificate of education gce advanced level cambridge computers zimsec (20)

June 04 P32
June 04 P32June 04 P32
June 04 P32
 
Nov 04 P2
Nov 04 P2Nov 04 P2
Nov 04 P2
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
 
June 05 P2
June 05 P2June 05 P2
June 05 P2
 
0417 s16 qp_22
0417 s16 qp_220417 s16 qp_22
0417 s16 qp_22
 
Nov 05 P2
Nov 05 P2Nov 05 P2
Nov 05 P2
 
Spreadsheets 101
Spreadsheets 101Spreadsheets 101
Spreadsheets 101
 
0417 m16 qp_31
0417 m16 qp_310417 m16 qp_31
0417 m16 qp_31
 
C++
C++C++
C++
 
School Based Assessment computer studies g8 2019 to g9 2020.docx
School Based Assessment computer studies g8 2019 to g9 2020.docxSchool Based Assessment computer studies g8 2019 to g9 2020.docx
School Based Assessment computer studies g8 2019 to g9 2020.docx
 
Microsoft Office: Practice Questions
Microsoft Office: Practice Questions Microsoft Office: Practice Questions
Microsoft Office: Practice Questions
 
0417 w09 qp_2
0417 w09 qp_20417 w09 qp_2
0417 w09 qp_2
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
 
0417 s16 qp_21
0417 s16 qp_210417 s16 qp_21
0417 s16 qp_21
 
Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++
 
0417 s14 qp_22
0417 s14 qp_220417 s14 qp_22
0417 s14 qp_22
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
 
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docxQuestion 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
 

More from Alpro

More from Alpro (20)

Accounting 970602 paper 2 structured questions october november 2008
Accounting 970602 paper 2 structured questions october november 2008 Accounting 970602 paper 2 structured questions october november 2008
Accounting 970602 paper 2 structured questions october november 2008
 
Accounting 970602 paper 2 structured questions october november 2007
Accounting 970602 paper 2 structured questions october november 2007 Accounting 970602 paper 2 structured questions october november 2007
Accounting 970602 paper 2 structured questions october november 2007
 
Accounting 970602 paper 2 structured questions october november 2006
Accounting 970602 paper 2 structured questions october november 2006 Accounting 970602 paper 2 structured questions october november 2006
Accounting 970602 paper 2 structured questions october november 2006
 
Accounting 970602 paper 2 structured questions for examination from 2016 spec...
Accounting 970602 paper 2 structured questions for examination from 2016 spec...Accounting 970602 paper 2 structured questions for examination from 2016 spec...
Accounting 970602 paper 2 structured questions for examination from 2016 spec...
 
Accounting 970602 paper 2 core topics for examination from 2010 specimen paper
Accounting 970602 paper 2 core topics for examination from 2010 specimen paperAccounting 970602 paper 2 core topics for examination from 2010 specimen paper
Accounting 970602 paper 2 core topics for examination from 2010 specimen paper
 
Accounting 970602 paper 2 core topics for examination from 2010 specimen mark...
Accounting 970602 paper 2 core topics for examination from 2010 specimen mark...Accounting 970602 paper 2 core topics for examination from 2010 specimen mark...
Accounting 970602 paper 2 core topics for examination from 2010 specimen mark...
 
Accounting 970601 paper 1 multiple choice october november 2008
Accounting 970601 paper 1 multiple choice october november 2008 Accounting 970601 paper 1 multiple choice october november 2008
Accounting 970601 paper 1 multiple choice october november 2008
 
Accounting 970601 paper 1 multiple choice october november 2007
Accounting 970601 paper 1 multiple choice october november 2007 Accounting 970601 paper 1 multiple choice october november 2007
Accounting 970601 paper 1 multiple choice october november 2007
 
Accounting 970601 paper 1 multiple choice october november 2006
Accounting 970601 paper 1 multiple choice october november 2006 Accounting 970601 paper 1 multiple choice october november 2006
Accounting 970601 paper 1 multiple choice october november 2006
 
Accounting 970601 paper 1 multiple choice for examination from 2016 specimen ...
Accounting 970601 paper 1 multiple choice for examination from 2016 specimen ...Accounting 970601 paper 1 multiple choice for examination from 2016 specimen ...
Accounting 970601 paper 1 multiple choice for examination from 2016 specimen ...
 
Accounting 97064 paper 4 problem solving (extension topics) may june session ...
Accounting 97064 paper 4 problem solving (extension topics) may june session ...Accounting 97064 paper 4 problem solving (extension topics) may june session ...
Accounting 97064 paper 4 problem solving (extension topics) may june session ...
 
Accounting 97062 paper 2 structured questions may june session 2002
Accounting 97062 paper 2 structured questions may june session 2002 Accounting 97062 paper 2 structured questions may june session 2002
Accounting 97062 paper 2 structured questions may june session 2002
 
Accounting 97061 paper 1 multiple choice october november 201
Accounting 97061 paper 1 multiple choice october november 201 Accounting 97061 paper 1 multiple choice october november 201
Accounting 97061 paper 1 multiple choice october november 201
 
Accounting 97061 paper 1 multiple choice may june session 2002
Accounting 97061 paper 1 multiple choice may june session 2002 Accounting 97061 paper 1 multiple choice may june session 2002
Accounting 97061 paper 1 multiple choice may june session 2002
 
Accounting 9706 41 paper 4 problem solving (supplementary topics) october nov...
Accounting 9706 41 paper 4 problem solving (supplementary topics) october nov...Accounting 9706 41 paper 4 problem solving (supplementary topics) october nov...
Accounting 9706 41 paper 4 problem solving (supplementary topics) october nov...
 
Accounting 9706 31 paper 3 multiple choice october november 2013
Accounting 9706 31 paper 3 multiple choice october november 2013 Accounting 9706 31 paper 3 multiple choice october november 2013
Accounting 9706 31 paper 3 multiple choice october november 2013
 
Accounting 9706 11 paper 1 multiple choice october november 2014
Accounting 9706 11 paper 1 multiple choice october november 2014Accounting 9706 11 paper 1 multiple choice october november 2014
Accounting 9706 11 paper 1 multiple choice october november 2014
 
9706 accounting november 2012 principal examiner report for teachers 2012 ac...
9706 accounting november 2012 principal examiner report for teachers  2012 ac...9706 accounting november 2012 principal examiner report for teachers  2012 ac...
9706 accounting november 2012 principal examiner report for teachers 2012 ac...
 
9706 accounting november 2011 principal examiner report for teachers 2011 ac...
9706 accounting november 2011 principal examiner report for teachers  2011 ac...9706 accounting november 2011 principal examiner report for teachers  2011 ac...
9706 accounting november 2011 principal examiner report for teachers 2011 ac...
 
9706 accounting november 2011 grade thresholds university of cambridge intern...
9706 accounting november 2011 grade thresholds university of cambridge intern...9706 accounting november 2011 grade thresholds university of cambridge intern...
9706 accounting november 2011 grade thresholds university of cambridge intern...
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 

Computing Paper 2 Practical Tests may june 2004 general certificate of education gce advanced level cambridge computers zimsec

  • 1. CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level COMPUTING 9691/02 Paper 2: Practical Tasks May/June 2004 READ THESE INSTRUCTIONS FIRST Write your Centre number, candidate number and name on all the work you hand in. Write in dark blue or black pen on both sides of the paper. Do not use staples, paper clips, highlighters, glue or correction fluid. Answer all questions. The number of marks is given in brackets [ ] at the end of each question or part question. This document consists of 5 printed pages and 3 blank pages. Ó CIE 2004 [Turn over
  • 2. 2 9691/2/M/J/04 Answer all questions. Task 1 [29 marks] This is a software development task and an implementation task. An English department in a college expects students to read a number of books which the Department keeps in its library. The Department wishes to keep details of books borrowed by students to ensure that the students read the books set by the tutors. A student borrows many books and a book is borrowed by many students. A database consisting of the tables Student, Book and StudentBook is to be created. The StudentBook table is used to link the other two tables and has the following attributes (fields), each with the specified data type. Attribute (field) Data Type StudentID Numeric type BookID Numeric type Date Borrowed Date type The key is a compound key formed from StudentID and BookID. (a) Create a table called Student to hold details of all the students. (i) Describe the · purpose of each attribute, · data type of each attribute. [6] (ii) Identify the key. [1] (b) Create a table called Book to hold the details of the books. (i) Describe the · purpose of each attribute, · data type of each attribute. [8] (ii) Identify the key. [1] (c) Create data for the three tables. You should have at least 20 students and 15 books. The data should be suitable for testing the tables. Include a print-out of your tables in your documentation. [7] (d) Create an interface that allows a user to input a book's ID and prints a report showing a list of the students who have borrowed that book and the dates on which each student borrowed the book. Provide hard copy evidence that the report is produced. [3] (e) Create an interface that allows a user to input a student's ID and prints a report showing a list of the books the student has borrowed and the dates on which each book was borrowed. Provide hard copy evidence that the report is produced. [3]
  • 3. 3 9691/2/M/J/04 [Turn over Task 2 [10 Marks] This is an algorithm trace task. No implementation is required. L, R and Data are one-dimensional arrays, each with 5 elements numbered from 1 to 5. The contents of the three arrays are shown in Fig. 2.1. Index L Index R Index Data 1 2 1 3 1 DOG 2 0 2 4 2 BEAR 3 5 3 0 3 HORSE 4 0 4 0 4 CAT 5 0 5 0 5 GIRAFFE Fig. 2.1 In these arrays, L(3) contains the number 5, R(2) contains the number 4 and Data(1) contains the data DOG. Read the following algorithm. T = 0 P = 1 REPEAT WHILE P <> 0 DO T = T + 1 S(T) = P P = L(P) END WHILE IF T > 0 THEN Finished = FALSE P = S(T) T = T – 1 OUTPUT Data(P) P = R(P) ELSE Finished = TRUE END IF UNTIL Finished EXIT Task 2 is continued on page 4 overleaf.
  • 4. 4 9691/2/M/J/04 Complete the trace table shown in Fig. 2.2. It is only necessary to enter values in the table when they change. You should work from left to right and top to bottom. The first six lines are completed for you. T P S(1) S(2) Finished Output 0 1 1 1 2 2 2 0 FALSE 2 Fig 2.2 [10]
  • 5. 5 9691/2/M/J/04 Task 3 [21 Marks] This is a software development task and an implementation task. Roman numerals are still used for certain limited purposes such as copyright dates. The symbols used are I =1, V = 5, X = 10, L = 50, C = 100, D = 500 and M =1000. One definition of Roman numbers is · the letters must be in descending order of value, · the value of the number is the sum of all the letters, · each letter must be used a minimum number of times. This is known as the additive rule and is the only rule to be used in this question. For example MCX = 1000 + 100 + 10 = 1110; MXC is invalid because of wrong order; IIII = 1 + 1 + 1 + 1 =4; IIIII is invalid because it can be replaced with V. A manufacturer wishes to make a new calculator that allows a user to input a number using Roman numerals and displays the number in both Roman and Arabic forms. The calculator must · allow a user to enter the Roman numerals up to a value of 7000 (MMMMMMM), · prevent the user entering an invalid numeral, · display the number entered using Roman numerals, · update this display as each Roman numeral is entered, · display the number entered using Arabic numerals, · update this display as each Roman numeral is entered, · allow the user to clear both displays, the Roman number and the Arabic number. The manufacturer wishes to use a simulation of this calculator so that the user interface can be tested. (a) Design a user interface that can be used to test the above facilities. Provide hard copy showing this design. (A screen dump is acceptable.) [5] (b) Using a high-level language of your choice, implement and test your design to show that all the above facilities work correctly. (i) Provide hard copy of your annotated program, stating the language and version used. [5] (ii) Provide a table showing your test data and the expected and actual results. [6] (iii) Supply hard copy evidence of testing your solution. (Screen dumps are acceptable, but must show the data entered and the results.) [5]