practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

Upload: deepak-dinesh

Post on 03-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    1/12

    Caribbean Examinations Council

    prepared by Lavare Henry

    CARIBBEAN EXAMINATIONS COUNCIL

    ADVANCED PROFICIENCY EXAMINATION

    COMPUTER SCIENCE

    PRACTICE PAPER

    UNIT 1FUNDAMENTALS OF COMPUTER SCIENCE

    PAPER 01

    1 hours

    INSTRUCTIONS TO CANDIDATES

    1. DO NOT open this examination paper until instructed to do so.2. Answer ALLquestions.

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    2/12

    ~ 2 ~

    GO ON TO THE NEXT PAGE

    1. A while loop is an example of which of the following constructs?(a) ascending(b) repetition(c) sequence(d) selection

    2. a subroutine which is define in terms of itself is said to be(a) iterative(b) recursive(c) selective(d) incremental

    3. A programming language that is English-like in nature and that is designed to manipulate arelational database can be BEST categorised as a

    (a) 1 GL(b) 2 GL(c) 4 GL(d) 5 GLItem 4 refers to the following information.

    Two students James and Richard wrote programs to solve a simple task. Each students program

    runs on his type of computer only but not on any other type of computer.

    4. The generation of languages used by BOTH students is(a) second(b) third(c) fourth(d) fifth

    5. James viewed the source code of a program and noticed patterns of binary digits throughout theprogram. The languages used is known as a

    (a)

    1

    st

    generation programming language(b) 2ndgeneration programming language(c) 3rdgeneration programming language(d) 4thgeneration programming language

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    3/12

    ~ 3 ~

    GO ON TO THE NEXT PAGE

    6. Joe wants to teach his little sister, Mary, about programming, but Mary is impatient and wantsto see things happen as soon as she enters program statements into the computer. Joe should

    use a language that utilises

    (a) an assembler(b) a compiler(c) an interpreter(d) a profiler

    7. Consider the following function Mystery that takes two input parameters A and B of type integerand returns an integer value:

    Function Mystery(A, B:integer):integer

    Begin

    if B is equal to 0 then

    ans = 1

    else

    ans = A * Mystery(A, B-1)

    endif

    return ans

    End Function

    (a) 1(b) 2(c) 8(d) 16

    8. Which of the following descriptions BEST suits the function of Cache memory?(a) It gives the CPU more rapid access to data(b) It increases data transfer rate between a computer and printer(c) It speeds up access to data on the hard disk(d) It stores the operating system when the computer boots.

    9. Which of the following devices would help prevent data loss in the event of an electrical outage?(a) power strip(b) surge protector(c) UPS(d) Voltage regulator

    10.A computers word size is the(a) length of an instruction(b) maximum number of characters in a typed word(c) storage capacity of the computers memory(d) number of bits that the CPU can manipulate at one time

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    4/12

    ~ 4 ~

    GO ON TO THE NEXT PAGE

    11.The 8-bit twos complement representation of the decimal numeral -39 is:(a) 00100110(b) 10100101(c) 11011001(d) 11100110

    12.The 8-bit sign and magnitude representation of the decimal numeral -25 is:(a) 10011001(b) 10100101(c) 11100111(d) 11100110

    13.What is the purpose of the program counter in a microcomputer?(a) to determine how many programs can be opened at one time(b) to determine the sequence in which the program instructions are to be executed(c) to hold the number of the last instruction executed(d) to keep a count of the number of instructions in memory

    14.Which of the following is not true of a flip flop?(a) it has two inputs(b) it has two outputs(c) is a bistable device(d) it can function as a 1-bit memory

    15.The list IVI represent steps in the computer-based problem solving process.I Analyse the problem

    II Code the solution

    III Define the problem

    IV Develop an algorithm

    V Maintain the program

    VI Test and debug the program

    Which of the following represents the correct sequence of steps in the computer-based problem

    solving process?

    (a) I, II, III, IV, V, VI(b) III, I, IV, II, VI, V(c) III, II, VI, IV, V, I(d) III, I, VI, II, V, VI

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    5/12

    ~ 5 ~

    GO ON TO THE NEXT PAGE

    Items 1617 refer to the following algorithm.

    Num = 5

    For I = 1 to Num do

    Print I * 2

    Endfor

    16.This algorithm is an example of(a) unbounded iteration(b) recursion(c) selection(d) bounded iteration

    17.What is the output of the algorithm?(a) 1 1(b) 1 2 3 4 5(c) 2 4 6 8 10(d) I*2 I*2 I*2 I*2 I*2 I*2

    18.What is the technical term for the graphical representation of an algorithm?(a) flowchart(b) HIPO chart(c) Narrative(d) Pseudocode

    19.Which of the following are properties of a well designed algorithm?I A finite number of steps

    II Flow of control from one process to the next

    III Correct syntax

    IV Ambiguous instructions

    (a) I and II only(b) I and III only(c) I, II, and III only(d) II, III and IV only

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    6/12

    ~ 6 ~

    GO ON TO THE NEXT PAGE

    20.What are the values of p and r after execution of the following algorithm?p = 8

    q = r

    r = 8

    if(p >q) AND (q>r)

    p = +1

    else

    r = r1

    endif

    (a) p = 7, r = 8(b) p = 9, r = 7(c) p = 7, r = 7(d) p = 8, r = 7

    21.What is the error in the following C program which is intended to print the string constant Cprogramming is fun?

    #include

    printf(C programming is fun);-

    (a) The brackets ( and ) should be on different lines.(b) The function main is missing.(c) The braces { and } should be on different lines.(d) Single quotation marks and should be used.

    22.Which of the following statements are true about programs and algorithms?I Every program uses algorithms

    II All programs are algorithms

    III Algorithms are derived from programs

    (a) I and II only(b) I and III only(c) II and III only(d) I, II and III

    23.Programming languages may be classified by Generation and Paradigm among other things.Which of the following is NOT an example of a programming language paradigm?

    (a) Imperative(b) Functional(c) Prerogative(d) Declarative

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    7/12

    ~ 7 ~

    GO ON TO THE NEXT PAGE

    Item 24 refers to the following algorithm

    #include

    main()

    {

    int a, b, sum;a = 10;

    b = 20;

    sum = a + b;

    printf(The sum of the numbers is %d /n, sum);

    }

    24.The program line: sum= a+b is an example of(a) a function call(b) a C operator(c) a variable declaration(d) the C assignment

    25.What output would you expect from the following program?#include

    main()

    {

    printf(One-----------------);

    printf(Two----------------);

    printf(Three\n);

    }

    (a) One--------Two----------Three(b) One-------, Two--------, Three(c) One---------

    Two---------

    Three\n

    (d) One-------, Two--------, Three\n26.Which of the following programs translates all program instructions at one time and produces a

    stand-alone object program that can be executed on its own?

    (a) an interpreter(b) a compiler(c) an assembler(d) a generator

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    8/12

    ~ 8 ~

    GO ON TO THE NEXT PAGE

    27.The compilation process can be broken up into THREE main stages. The CORRECT order of thestages is

    (a) syntax analysis, lexical analysis, code generation(b) lexical analysis, code generation, syntax analysis(c) lexical analysis, syntax analysis, code generation(d) code generation, lexical analysis, syntax analysis

    28.Consider the following partial declaration in C#include

    #define SIZE

    main)

    {

    int k;

    int table[SIZE];

    Which of the following lines of code read FIVE integers from the standard input?

    (a) for(k=0; k

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    9/12

    ~ 9 ~

    GO ON TO THE NEXT PAGE

    31.Many banks use ATMs to allow customers to access their accounts.What is the BEST type of computer for storing the account information to facilitate this

    procedure?

    (a) micro-computer(b) mainframe(c) mini-computer(d) single user

    32.Authentication of files would HELP increase the security of data by(a) keeping information error-free(b) allowing easy data protection(c) allowing easy data access(d) keeping data secure

    33.Wilmott Smith was contracted by a small manufacturing company to address problems beingexpressed in its data processing department. Which of the following arrangements of the stages

    in the problem solving process should he adopt in order to minimise difficulties?

    (a) problem analysis, problem definition, selection of solution, evaluation of possible solutions(b) problem definition, problem analysis, evaluation of possible solutions, selection of solution(c) problem definitions, problem analysis, selection of solution, evaluation of possible solution(d) problem definition, evaluation of possible solutions, problem analysis, selection of solution.

    34.The final state of the problem solving process is(a) implementation and review(b) selection of solution(c) problem definition(d) problem analysis

    35.Functional programming emphasises(a) the sending and receiving of messages(b) the changes in state of its variables(c) the execution of sequential commands(d) the evaluation of mathematical computation

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    10/12

    ~ 10 ~

    GO ON TO THE NEXT PAGE

    Item 3637 refer to the diagram below.

    36.What process does the diagram MOST likely represent?(a) debugging(b) programming(c) execution(d) compilation

    37.What is the correct order of the process?(a) I, II, III, IV, V(b) V, IV, III, II, I(c) IV, III, II, V, I(d) I, V, IV, I, IIII

    38.The instructions below represent an algorithm that simulates throwing a die a number of times.it displays the number of times each face appears and takes as input the number of throws to be

    made.

    Arrange the following instructions in the correct order. (ASSUME:

    1 RANDOM() is a function that returns a random integer.2 The array arr is initialised with 0sI For j= 1 to 6

    II arr[num] = arr[num]+1III num = (RANDOM() MOD 6) + 1

    IV ENDFOR

    V FOR i=1 to THROWS

    VI READ THROWS

    VII PRINT arr[j]

    Code (I)

    generation

    source

    code (II)

    lexical

    analysis(V)

    object

    code (III)

    syntax

    analysis(IV)

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    11/12

    GO ON TO THE NEXT PAGE

    (a) VI, V, III, II, IV, I, VII, IV(b) VI, I,III, IV, V, VII, IV(c) VI, V, III, II, I, VII, IV, IV(d) V, VI, II, III, IV, I, VII, IV

    39.Two students James and Richard wrote programs to solve a simple task. Each students programruns on his type of computer but not on any other type of computer.

    An example of a language used to write the program is

    (a) Java(b) Pascal(c) Basic(d) Assembly

    40.Consider the following statements:I ALL programs ARE algorithms

    II EVERY program USES algorithms

    III Algorithms are derived from programs

    Which of the above are true?

    (a) I and II only(b) I and III only(c) II and III only(d) I, II and III

    41.For which logic gate is the following tableA B C

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    (a) AND(b) OR(c) NOT(d) EOR

    42.What is the hexadecimal equivalent of the binary number: 111111012(a) FD16(b) 151316(c) 2A16(d) 25316

  • 8/12/2019 practicepaper-capecomputerscienceunit1paper1-140114225056-phpapp01

    12/12

    ~ 12 ~

    END OF TEST

    43.What is the binary equivalent of the hexadecimal number CB16(a) 101011012(b) 010011002(c) 110010112(d) 101111112

    44.What is the binary equivalent to the decimal number 2510(a) 11012(b) 110012(c) 001001201(d) 11102

    45.The diagram below represents what type of logic gate:

    (a) AND(b) OR(c) NOT(d) EOR

    IF YOU FINISH BEFORE TIME IS CALLED, CHECK YOUR WORK ON THIS TEST.