SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS
                            General Certificate of Education
                     Advanced Subsidiary Level and Advanced Level

         COMPUTING
         Paper 2: Practical Tasks

                                                                                  May/June 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 06_9691_02/FP
 UCLES 2005                                                                                   [Turn over




                                www.xtremepapers.net
2

                                         Answer all questions

Task 1 [22 marks]

This is a design and implementation task

At a university a lecturer may teach many modules and a module may be taught by many lecturers.

Lecturers have an office and a telephone number. Several lecturers, who may have to share a
telephone, may use an office. An office is identified by a 5-character code consisting of two
uppercase letters followed by three digits such as AB123. The telephone number consists of four
digits such as 0362. The lecturer’s name is the only personal data to be stored.

Modules have a module code consisting of two letters and four digits such as IT1002. Each module
has a title such as Information Technology.


    (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 a lecturer to the appropriate table.

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

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


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


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




© UCLES 2005                                  9691/02/M/J/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 < "0" OR Ch > "9" 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 < "0" OR Ch > "9" 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/M/J/05                               [Turn over


                             www.xtremepapers.net
4

When the procedure is called with

    Validate("58")

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,
                                                                       58          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(".376");                                                                  [4]

        (ii) Validate("4.9");                                                                      [7]

        (iii) Validate("6.2.7").                                                                   [7]




© UCLES 2005                                       9691/02/M/J/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 binary calculator using a high-level language of your
choice. A binary calculator can only use the digits 0 and 1. This calculator will allow the user to enter
two unsigned binary 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 binary.

To do this you are advised to follow these steps.

    (a) Design an interface that will allow the user to input two unsigned binary 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 BinaryToDecimal, that will accept a binary number as a parameter
        and will return its decimal equivalent. For example,

                        BinaryToDecimal(101101) will return the decimal value 45.

         You may use the following algorithm to do this.

               Input the binary number as a string
               Total = 0
               For each binary digit in the string, starting on the left,
                     Total = Total * 2 + value of 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 DecimalToBinary, that will accept a decimal number as a parameter
        and will return its binary equivalent. For example,

                         DecimalToBinary (47) will return the binary value 101111.

         You may use the following algorithm to do this.

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

         & means concatenation. For example

                                            "1010" & "1" = "10101"

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


© UCLES 2005                                      9691/02/M/J/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 binary numbers input by the user to decimal, do the operation
        and then convert the result back to binary before displaying it. 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/M/J/05



                               www.xtremepapers.net
7

      BLANK PAGE




       9691/02/M/J/05



www.xtremepapers.net
8

                                                                   BLANK PAGE




Every reasonable effort has been made to trace all copyright holders. The publishers would be pleased to hear from anyone whose rights we 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/M/J/05



                                              www.xtremepapers.net

Contenu connexe

Tendances

Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answersRandalHoffman
 
CIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comCIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comclaric59
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingRenas Rekany
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...FarhanAhmade
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii kvs
 
Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 FarhanAhmade
 
11th information practices paper CBSE INDIA 2012 2013
11th information practices paper CBSE INDIA 2012 201311th information practices paper CBSE INDIA 2012 2013
11th information practices paper CBSE INDIA 2012 2013Harish Gyanani
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSSuraj Kumar
 
CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.comjonhson110
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representationPooja Tripathi
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notesInfinity Tech Solutions
 
Proyecto parcial ii_grupo2.docx
Proyecto parcial ii_grupo2.docxProyecto parcial ii_grupo2.docx
Proyecto parcial ii_grupo2.docxLuisCuevaFlores
 

Tendances (19)

Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answers
 
CIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.comCIS 115 Education Counseling--cis115.com
CIS 115 Education Counseling--cis115.com
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Python Programming
Python Programming Python Programming
Python Programming
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
 
CBSE Sample Paper IP
CBSE Sample Paper IPCBSE Sample Paper IP
CBSE Sample Paper IP
 
Primitives
PrimitivesPrimitives
Primitives
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii
 
Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021
 
11th information practices paper CBSE INDIA 2012 2013
11th information practices paper CBSE INDIA 2012 201311th information practices paper CBSE INDIA 2012 2013
11th information practices paper CBSE INDIA 2012 2013
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
 
CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.com
 
Input output
Input outputInput output
Input output
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representation
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
 
Qno 3 (a)
Qno 3 (a)Qno 3 (a)
Qno 3 (a)
 
Qno 2 (c)
Qno 2 (c)Qno 2 (c)
Qno 2 (c)
 
Proyecto parcial ii_grupo2.docx
Proyecto parcial ii_grupo2.docxProyecto parcial ii_grupo2.docx
Proyecto parcial ii_grupo2.docx
 
Midterm sols
Midterm solsMidterm sols
Midterm sols
 

Similaire à June 05 P2

Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 solIIUM
 
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 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
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01abdalodainat
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdfvikas500500
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
Cmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.comCmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.comStephenson22
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comWilliamsTaylorza48
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.comHarrisGeorg12
 
#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docxmayank272369
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newLast7693
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newscottbrownnn
 
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
 

Similaire à June 05 P2 (20)

Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
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 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...
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdf
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
Nov 02 P2
Nov 02 P2Nov 02 P2
Nov 02 P2
 
Cmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.comCmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.com
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
 
C++
C++C++
C++
 
#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx#include iostream#includectimeusing namespace std;void.docx
#include iostream#includectimeusing namespace std;void.docx
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
 
Portfolio2
Portfolio2Portfolio2
Portfolio2
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Ch3
Ch3Ch3
Ch3
 
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...
 

Plus de Samimvez

Plus de 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
 

Dernier

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 

Dernier (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

June 05 P2

  • 1. UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level COMPUTING Paper 2: Practical Tasks May/June 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 06_9691_02/FP  UCLES 2005 [Turn over www.xtremepapers.net
  • 2. 2 Answer all questions Task 1 [22 marks] This is a design and implementation task At a university a lecturer may teach many modules and a module may be taught by many lecturers. Lecturers have an office and a telephone number. Several lecturers, who may have to share a telephone, may use an office. An office is identified by a 5-character code consisting of two uppercase letters followed by three digits such as AB123. The telephone number consists of four digits such as 0362. The lecturer’s name is the only personal data to be stored. Modules have a module code consisting of two letters and four digits such as IT1002. Each module has a title such as Information Technology. (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 a lecturer to the appropriate table. (ii) Create a form that will allow the user to add a module to the appropriate table. (iii) Create a form that will allow a user to link a lecturer to a module. The form should allow the user to choose a lecturer from a list and to choose a module from a list. [6] (c) Create a query that, when run, requests a user to select a lecturer and then lists all the modules taught by that lecturer. Include evidence that your query works correctly. [2] (d) Create a report that lists the lecturers for each module. The report should group the information on module code and have appropriate headings. Include evidence that your report is correct. [3] © UCLES 2005 9691/02/M/J/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 < "0" OR Ch > "9" 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 < "0" OR Ch > "9" 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/M/J/05 [Turn over www.xtremepapers.net
  • 4. 4 When the procedure is called with Validate("58") 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, 58 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(".376"); [4] (ii) Validate("4.9"); [7] (iii) Validate("6.2.7"). [7] © UCLES 2005 9691/02/M/J/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 binary calculator using a high-level language of your choice. A binary calculator can only use the digits 0 and 1. This calculator will allow the user to enter two unsigned binary 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 binary. To do this you are advised to follow these steps. (a) Design an interface that will allow the user to input two unsigned binary 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 BinaryToDecimal, that will accept a binary number as a parameter and will return its decimal equivalent. For example, BinaryToDecimal(101101) will return the decimal value 45. You may use the following algorithm to do this. Input the binary number as a string Total = 0 For each binary digit in the string, starting on the left, Total = Total * 2 + value of 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 DecimalToBinary, that will accept a decimal number as a parameter and will return its binary equivalent. For example, DecimalToBinary (47) will return the binary value 101111. You may use the following algorithm to do this. Input the decimal number called Number Binary = "" 'Empty string Repeat Remainder = remainder after Number is divided by 2 Number = Whole part of Number divided by 2 Binary = String value of Remainder & Binary Until Number = 0 & means concatenation. For example "1010" & "1" = "10101" You should clearly annotate your code and use meaningful names for variables and other objects such as buttons. You should include a copy of your code as evidence. [4] © UCLES 2005 9691/02/M/J/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 binary numbers input by the user to decimal, do the operation and then convert the result back to binary before displaying it. 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/M/J/05 www.xtremepapers.net
  • 7. 7 BLANK PAGE 9691/02/M/J/05 www.xtremepapers.net
  • 8. 8 BLANK PAGE Every reasonable effort has been made to trace all copyright holders. The publishers would be pleased to hear from anyone whose rights we 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/M/J/05 www.xtremepapers.net