SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS
                            General Certificate of Education
                     Advanced Subsidiary Level and Advanced Level

         COMPUTING
         Paper 2: Practical Tasks

                                                                       October/November 2005




  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 6 printed pages and 2 blank pages.
IB05 11_9691_02/4RP
 UCLES 2005                                                                                   [Turn over




                                www.xtremepapers.net
2

                                         Answer all questions.
Task 1 [22 marks]

This is a design and implementation task.

A library requires a database to hold details of its books and authors. An author may write many
books and a book may be written by many authors.

Authors have an address and a telephone number. The telephone number consists of 11 digits such
as 01543564329. The author’s name, address and telephone number are the only personal data to be
stored.

Books have a book number consisting of two letters and four digits such as CS1002. Each book has a
title and a publisher.


    (a) Design a database, consisting of three tables, to store the data. You should include evidence
        showing the attributes of the tables together with their data types and any validation rules you
        have used. Screen dumps are acceptable for this purpose.                                     [11]

Create sufficient data to complete the rest of this task. Provide copies of your completed tables.
Screen dumps are acceptable for this purpose.


    (b) (i) Create a form that will allow the user to add an author to the appropriate table.

        (ii) Create a form that will allow the user to add a book to the appropriate table.

        (iii) Create a form that will allow a user to link an author to a book. The form should allow the
              user to choose an author from a list and to choose a book from a list.                   [6]


    (c) Create a query that, when run, requests a user to select an author and then lists all the books
        written by that author. Include evidence that your query works correctly.                    [2]


    (d) Create a report that lists the authors for each book. The report should group the information
        on book number and have appropriate headings. Include evidence that your report is correct.
                                                                                                   [3]




© UCLES 2005                                  9691/02/O/N/05



                               www.xtremepapers.net
3

Task 2 [18 Marks]

This is a white box test task. No implementation is required.

Read the following algorithm for a procedure, called Validate, in which each step has been numbered.

Validate(aString)
1 Length = Len(aString)
2     IF Length = 0 THEN
3        Output "Empty string is not allowed"
4     ELSE
5        OK = TRUE
6        DP = FALSE
7        Count = 1
8        Ch = 1st character of aString
9        IF Ch < "i" OR Ch > "n" THEN
10          OK = FALSE
11       ELSE
12          WHILE Count < Length AND OK DO
13             Count = Count + 1
14             Ch = next character in aString
15             IF Ch = "." THEN
16                IF DP THEN
17                   OK = FALSE
18                ELSE
19                   DP = TRUE
20                ENDIF
21             ELSE
22                IF Ch < "a" OR Ch > "z" THEN
23                   OK = FALSE
24                ENDIF
25             ENDIF
26          ENDWHILE
27       ENDIF
28       IF OK THEN
29          Output "Valid string"
30       ELSE
31          Output "Invalid string"
32       ENDIF
33    ENDIF
34 END PROCEDURE Validate

The function Len(aString) returns the number of characters in aString. For example, if aString =
"Computer", Len(aString) = 8.




© UCLES 2005                                9691/02/O/N/05                               [Turn over


                             www.xtremepapers.net
4

When the procedure is called with

    Validate("kg")

the lines

    1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 21, 22, 24, 25, 26, 12, 26, 27, 28, 29, 30,
    32, 33, 34

are executed and the output is

    Valid string

The example test above can be described as shown in Table 2.1.

             Path                                                   Test Data   Expected Output

             1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 21, 22,
                                                                       kg         Valid string
             24, 25, 26, 12, 26, 27, 28, 29, 30, 32, 33, 34

                                                    Table 2.1


Using a table similar to Table 2.1, write down the lines that are executed and the output when the
procedure is called with

            (i) Validate(".doc");                                                                 [4]

        (ii) Validate("m.d");                                                                     [7]

        (iii) Validate("j.b.w").                                                                  [7]




© UCLES 2005                                       9691/02/O/N/05



                                    www.xtremepapers.net
5

Task 3 [20 marks]

This is a design and implementation task.

You are to design and create a very simple octal calculator using a high-level language of your
choice. An octal calculator can only use the digits 0 to 7. This calculator will allow the user to enter
two unsigned octal numbers and will then allow the user to add, subtract, multiply or divide these
numbers. In the case of division, the result should be truncated to a whole number. This is
equivalent to integer division. The result is to be displayed in octal.

To do this you are advised to follow these steps.

    (a) Design an interface that will allow the user to input two unsigned octal numbers and will
        display them in two boxes. The user should then be able to choose addition, subtraction,
        multiplication or division. There should be a box to show the result of the calculation. The
        user should also be able to clear all the boxes. (No processing is required at this stage.) [4]

    (b) Create a function, called OctalToDecimal, that will accept an octal number as a parameter
        and will return its decimal equivalent. For example,

                          OctalToDecimal(253) will return the decimal value 171.

         You may use the following algorithm to do this.

               Input the octal number as a string
               Total = 0
               For each octal digit in the string, starting on the left,
                     Total = Total * 8 + value of next digit
               Return Total

         You should clearly annotate your code and use meaningful names for variables and other
         objects such as buttons and text boxes (if you use them). You should include a copy of your
         code as evidence.                                                                        [4]

    (c) Create a function, called DecimalToOctal, that will accept a decimal number as a parameter
        and will return its octal equivalent. For example,

                           DecimalToOctal (171) will return the octal value 253.

         You may use the following algorithm to do this.

               Input the decimal number called Number
               Octal = ""              'Empty string
               Repeat
                     Remainder = remainder after Number is divided by 8
                     Number = Whole part of Number divided by 8
                     Octal = String value of Remainder & Octal
               Until Number = 0

         & means concatenation. For example

                                             "5" & "263" = "5263"

         You should clearly annotate your code and use meaningful names for variables and other
         objects such as buttons (if you use them). You should include a copy of your code as
         evidence.                                                                           [4]


© UCLES 2005                                      9691/02/O/N/05                            [Turn over


                                  www.xtremepapers.net
6

    (d) Create code for each of the operations of addition, subtraction, multiplication and division.
        You are advised to change the octal numbers input by the user to decimal, do the operation
        and then convert the result back to octal before displaying the result. You should include a
        copy of your code as evidence.                                                            [3]

    (e) Create a set of test data that shows that the operations of addition, subtraction, multiplication
        and division work and provide evidence that you have used this data. Screen dumps are
        acceptable but must show the data entered and the result of the operation.                     [5]




© UCLES 2005                                  9691/02/O/N/05



                               www.xtremepapers.net
7

      BLANK PAGE




       9691/02/O/N/05



www.xtremepapers.net
8

                                                                  BLANK PAGE




Every reasonable effort has been made to trace all copyright holders where the publishers (i.e. UCLES) are aware that third-party material has been
reproduced. The publishers would be pleased to hear from anyone whose rights they have unwittingly infringed.

University of Cambridge International Examinations is part of the University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department
of the University of Cambridge.

                                                                     9691/02/O/N/05



                                              www.xtremepapers.net

Weitere ähnliche Inhalte

Was ist angesagt?

Mathematica tutorial 3
Mathematica tutorial 3Mathematica tutorial 3
Mathematica tutorial 3coolsumayya
 
Jinnai fukunaga-2016
Jinnai fukunaga-2016Jinnai fukunaga-2016
Jinnai fukunaga-2016Yuu Jinnai
 
Matlab 1
Matlab 1Matlab 1
Matlab 1asguna
 
Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesEelco Visser
 
Declarative Language Definition
Declarative Language DefinitionDeclarative Language Definition
Declarative Language DefinitionEelco Visser
 
Mining Functional Patterns
Mining Functional PatternsMining Functional Patterns
Mining Functional PatternsDebasish Ghosh
 
Linear models
Linear modelsLinear models
Linear modelsFAO
 
Csphtp1 16
Csphtp1 16Csphtp1 16
Csphtp1 16HUST
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917lakshmi r
 
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...Philip Schwarz
 
Multiple graphs in openCypher
Multiple graphs in openCypherMultiple graphs in openCypher
Multiple graphs in openCypheropenCypher
 
Paper fingerprinting using alpha-masked image matching
Paper fingerprinting using alpha-masked image matchingPaper fingerprinting using alpha-masked image matching
Paper fingerprinting using alpha-masked image matchingTuan Q. Pham
 
Arrays, Structures And Enums
Arrays, Structures And EnumsArrays, Structures And Enums
Arrays, Structures And EnumsBhushan Mulmule
 
Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answersRandalHoffman
 

Was ist angesagt? (20)

Monad
MonadMonad
Monad
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Mathematica tutorial 3
Mathematica tutorial 3Mathematica tutorial 3
Mathematica tutorial 3
 
White box-sol
White box-solWhite box-sol
White box-sol
 
Jinnai fukunaga-2016
Jinnai fukunaga-2016Jinnai fukunaga-2016
Jinnai fukunaga-2016
 
Matlab 1
Matlab 1Matlab 1
Matlab 1
 
Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languages
 
Declarative Language Definition
Declarative Language DefinitionDeclarative Language Definition
Declarative Language Definition
 
2D Plot Matlab
2D Plot Matlab2D Plot Matlab
2D Plot Matlab
 
Mining Functional Patterns
Mining Functional PatternsMining Functional Patterns
Mining Functional Patterns
 
Linear models
Linear modelsLinear models
Linear models
 
Sql server lab_2
Sql server lab_2Sql server lab_2
Sql server lab_2
 
Ti1220 Lecture 2
Ti1220 Lecture 2Ti1220 Lecture 2
Ti1220 Lecture 2
 
Csphtp1 16
Csphtp1 16Csphtp1 16
Csphtp1 16
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
 
Multiple graphs in openCypher
Multiple graphs in openCypherMultiple graphs in openCypher
Multiple graphs in openCypher
 
Paper fingerprinting using alpha-masked image matching
Paper fingerprinting using alpha-masked image matchingPaper fingerprinting using alpha-masked image matching
Paper fingerprinting using alpha-masked image matching
 
Arrays, Structures And Enums
Arrays, Structures And EnumsArrays, Structures And Enums
Arrays, Structures And Enums
 
Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answers
 

Andere mochten auch

el paso 05_16Wright_Wachovia
el paso  05_16Wright_Wachoviael paso  05_16Wright_Wachovia
el paso 05_16Wright_Wachoviafinance49
 
Hanks' Lesson Plans December 14 17
Hanks' Lesson Plans December 14 17Hanks' Lesson Plans December 14 17
Hanks' Lesson Plans December 14 17hanks1mr
 
Nov 05 MS1
Nov 05 MS1Nov 05 MS1
Nov 05 MS1Samimvez
 
Desde Paraguay, homenaje a mujeres haitianas
Desde Paraguay, homenaje a mujeres haitianasDesde Paraguay, homenaje a mujeres haitianas
Desde Paraguay, homenaje a mujeres haitianasWebmistress Paraguay
 

Andere mochten auch (6)

Nassser ajaln aziz_group
Nassser ajaln aziz_groupNassser ajaln aziz_group
Nassser ajaln aziz_group
 
el paso 05_16Wright_Wachovia
el paso  05_16Wright_Wachoviael paso  05_16Wright_Wachovia
el paso 05_16Wright_Wachovia
 
Hanks' Lesson Plans December 14 17
Hanks' Lesson Plans December 14 17Hanks' Lesson Plans December 14 17
Hanks' Lesson Plans December 14 17
 
Nov 05 MS1
Nov 05 MS1Nov 05 MS1
Nov 05 MS1
 
Sonrie.....
Sonrie.....Sonrie.....
Sonrie.....
 
Desde Paraguay, homenaje a mujeres haitianas
Desde Paraguay, homenaje a mujeres haitianasDesde Paraguay, homenaje a mujeres haitianas
Desde Paraguay, homenaje a mujeres haitianas
 

Ähnlich wie Nov 05 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...Alpro
 
June 04 P32
June 04 P32June 04 P32
June 04 P32Samimvez
 
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...Computing Paper 2 Practical Tests may june 2004 general certificate of educat...
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...Alpro
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0PMILebanonChapter
 
Computing 9691 Test Paper Paper 3 for May / June 2007 Cambridge
Computing 9691 Test Paper Paper 3 for May / June 2007 CambridgeComputing 9691 Test Paper Paper 3 for May / June 2007 Cambridge
Computing 9691 Test Paper Paper 3 for May / June 2007 CambridgeAlpro
 
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...Alpro
 
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptxMrhaider4
 
Arrry structure Stacks in data structure
Arrry structure Stacks  in data structureArrry structure Stacks  in data structure
Arrry structure Stacks in data structurelodhran-hayat
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202Mahmoud Samir Fayed
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CSAAKASH KUMAR
 

Ähnlich wie Nov 05 P2 (20)

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...
 
Nov 04 P2
Nov 04 P2Nov 04 P2
Nov 04 P2
 
June 04 P32
June 04 P32June 04 P32
June 04 P32
 
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...Computing Paper 2 Practical Tests may june 2004 general certificate of educat...
Computing Paper 2 Practical Tests may june 2004 general certificate of educat...
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
 
Computing 9691 Test Paper Paper 3 for May / June 2007 Cambridge
Computing 9691 Test Paper Paper 3 for May / June 2007 CambridgeComputing 9691 Test Paper Paper 3 for May / June 2007 Cambridge
Computing 9691 Test Paper Paper 3 for May / June 2007 Cambridge
 
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...
Computing 9195 Zimbabwe Zimsec syllabus Cambridge Computers may June 2007 pap...
 
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptx
 
Introduction to DAX Language
Introduction to DAX LanguageIntroduction to DAX Language
Introduction to DAX Language
 
Arrry structure Stacks in data structure
Arrry structure Stacks  in data structureArrry structure Stacks  in data structure
Arrry structure Stacks in data structure
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
C++
C++C++
C++
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Sample paper i.p
Sample paper i.pSample paper i.p
Sample paper i.p
 
CST2403 NOTES
CST2403 NOTESCST2403 NOTES
CST2403 NOTES
 
Aspdot
AspdotAspdot
Aspdot
 
Portfolio2
Portfolio2Portfolio2
Portfolio2
 

Mehr von Samimvez

Mehr von Samimvez (20)

Sql installation tutorial
Sql installation tutorialSql installation tutorial
Sql installation tutorial
 
Example3
Example3Example3
Example3
 
Coms1010 exam paper - nov10
Coms1010   exam paper - nov10Coms1010   exam paper - nov10
Coms1010 exam paper - nov10
 
Coms1010 exam paper - may 08
Coms1010   exam paper - may 08Coms1010   exam paper - may 08
Coms1010 exam paper - may 08
 
Example2
Example2Example2
Example2
 
Labsheet 3
Labsheet 3Labsheet 3
Labsheet 3
 
Labsheet 3,5
Labsheet 3,5Labsheet 3,5
Labsheet 3,5
 
EQ V3x
EQ V3xEQ V3x
EQ V3x
 
Eq v2
Eq v2Eq v2
Eq v2
 
3.6
3.63.6
3.6
 
3.2
3.23.2
3.2
 
3.10
3.103.10
3.10
 
3.1
3.13.1
3.1
 
3.3
3.33.3
3.3
 
3.8
3.83.8
3.8
 
3.4
3.43.4
3.4
 
3.7
3.73.7
3.7
 
3.5
3.53.5
3.5
 
3.9
3.93.9
3.9
 
Nov 05 P3
Nov 05 P3Nov 05 P3
Nov 05 P3
 

Kürzlich hochgeladen

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Kürzlich hochgeladen (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Nov 05 P2

  • 1. UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level COMPUTING Paper 2: Practical Tasks October/November 2005 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 6 printed pages and 2 blank pages. IB05 11_9691_02/4RP  UCLES 2005 [Turn over www.xtremepapers.net
  • 2. 2 Answer all questions. Task 1 [22 marks] This is a design and implementation task. A library requires a database to hold details of its books and authors. An author may write many books and a book may be written by many authors. Authors have an address and a telephone number. The telephone number consists of 11 digits such as 01543564329. The author’s name, address and telephone number are the only personal data to be stored. Books have a book number consisting of two letters and four digits such as CS1002. Each book has a title and a publisher. (a) Design a database, consisting of three tables, to store the data. You should include evidence showing the attributes of the tables together with their data types and any validation rules you have used. Screen dumps are acceptable for this purpose. [11] Create sufficient data to complete the rest of this task. Provide copies of your completed tables. Screen dumps are acceptable for this purpose. (b) (i) Create a form that will allow the user to add an author to the appropriate table. (ii) Create a form that will allow the user to add a book to the appropriate table. (iii) Create a form that will allow a user to link an author to a book. The form should allow the user to choose an author from a list and to choose a book from a list. [6] (c) Create a query that, when run, requests a user to select an author and then lists all the books written by that author. Include evidence that your query works correctly. [2] (d) Create a report that lists the authors for each book. The report should group the information on book number and have appropriate headings. Include evidence that your report is correct. [3] © UCLES 2005 9691/02/O/N/05 www.xtremepapers.net
  • 3. 3 Task 2 [18 Marks] This is a white box test task. No implementation is required. Read the following algorithm for a procedure, called Validate, in which each step has been numbered. Validate(aString) 1 Length = Len(aString) 2 IF Length = 0 THEN 3 Output "Empty string is not allowed" 4 ELSE 5 OK = TRUE 6 DP = FALSE 7 Count = 1 8 Ch = 1st character of aString 9 IF Ch < "i" OR Ch > "n" THEN 10 OK = FALSE 11 ELSE 12 WHILE Count < Length AND OK DO 13 Count = Count + 1 14 Ch = next character in aString 15 IF Ch = "." THEN 16 IF DP THEN 17 OK = FALSE 18 ELSE 19 DP = TRUE 20 ENDIF 21 ELSE 22 IF Ch < "a" OR Ch > "z" THEN 23 OK = FALSE 24 ENDIF 25 ENDIF 26 ENDWHILE 27 ENDIF 28 IF OK THEN 29 Output "Valid string" 30 ELSE 31 Output "Invalid string" 32 ENDIF 33 ENDIF 34 END PROCEDURE Validate The function Len(aString) returns the number of characters in aString. For example, if aString = "Computer", Len(aString) = 8. © UCLES 2005 9691/02/O/N/05 [Turn over www.xtremepapers.net
  • 4. 4 When the procedure is called with Validate("kg") the lines 1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 21, 22, 24, 25, 26, 12, 26, 27, 28, 29, 30, 32, 33, 34 are executed and the output is Valid string The example test above can be described as shown in Table 2.1. Path Test Data Expected Output 1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 21, 22, kg Valid string 24, 25, 26, 12, 26, 27, 28, 29, 30, 32, 33, 34 Table 2.1 Using a table similar to Table 2.1, write down the lines that are executed and the output when the procedure is called with (i) Validate(".doc"); [4] (ii) Validate("m.d"); [7] (iii) Validate("j.b.w"). [7] © UCLES 2005 9691/02/O/N/05 www.xtremepapers.net
  • 5. 5 Task 3 [20 marks] This is a design and implementation task. You are to design and create a very simple octal calculator using a high-level language of your choice. An octal calculator can only use the digits 0 to 7. This calculator will allow the user to enter two unsigned octal numbers and will then allow the user to add, subtract, multiply or divide these numbers. In the case of division, the result should be truncated to a whole number. This is equivalent to integer division. The result is to be displayed in octal. To do this you are advised to follow these steps. (a) Design an interface that will allow the user to input two unsigned octal numbers and will display them in two boxes. The user should then be able to choose addition, subtraction, multiplication or division. There should be a box to show the result of the calculation. The user should also be able to clear all the boxes. (No processing is required at this stage.) [4] (b) Create a function, called OctalToDecimal, that will accept an octal number as a parameter and will return its decimal equivalent. For example, OctalToDecimal(253) will return the decimal value 171. You may use the following algorithm to do this. Input the octal number as a string Total = 0 For each octal digit in the string, starting on the left, Total = Total * 8 + value of next digit Return Total You should clearly annotate your code and use meaningful names for variables and other objects such as buttons and text boxes (if you use them). You should include a copy of your code as evidence. [4] (c) Create a function, called DecimalToOctal, that will accept a decimal number as a parameter and will return its octal equivalent. For example, DecimalToOctal (171) will return the octal value 253. You may use the following algorithm to do this. Input the decimal number called Number Octal = "" 'Empty string Repeat Remainder = remainder after Number is divided by 8 Number = Whole part of Number divided by 8 Octal = String value of Remainder & Octal Until Number = 0 & means concatenation. For example "5" & "263" = "5263" You should clearly annotate your code and use meaningful names for variables and other objects such as buttons (if you use them). You should include a copy of your code as evidence. [4] © UCLES 2005 9691/02/O/N/05 [Turn over www.xtremepapers.net
  • 6. 6 (d) Create code for each of the operations of addition, subtraction, multiplication and division. You are advised to change the octal numbers input by the user to decimal, do the operation and then convert the result back to octal before displaying the result. You should include a copy of your code as evidence. [3] (e) Create a set of test data that shows that the operations of addition, subtraction, multiplication and division work and provide evidence that you have used this data. Screen dumps are acceptable but must show the data entered and the result of the operation. [5] © UCLES 2005 9691/02/O/N/05 www.xtremepapers.net
  • 7. 7 BLANK PAGE 9691/02/O/N/05 www.xtremepapers.net
  • 8. 8 BLANK PAGE Every reasonable effort has been made to trace all copyright holders where the publishers (i.e. UCLES) are aware that third-party material has been reproduced. The publishers would be pleased to hear from anyone whose rights they have unwittingly infringed. University of Cambridge International Examinations is part of the University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge. 9691/02/O/N/05 www.xtremepapers.net