CAPE Computer Science Unit 1 Paper 1 - Practice Paper

12
Caribbean Examinations Council prepared by Lavare Henry CARIBBEAN EXAMINATIONS COUNCIL ADVANCED PROFICIENCY EXAMINATION COMPUTER SCIENCE PRACTICE PAPER UNIT 1 FUNDAMENTALS OF COMPUTER SCIENCE PAPER 01 1 ½ hours INSTRUCTIONS TO CANDIDATES 1. DO NOT open this examination paper until instructed to do so. 2. Answer ALL questions.

description

CAPE Computer Science Unit 1 Paper 1 - Practice Paper

Transcript of CAPE Computer Science Unit 1 Paper 1 - Practice Paper

Page 1: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

Caribbean Examinations Council prepared by Lavare Henry

CARIBBEAN EXAMINATIONS COUNCIL

ADVANCED PROFICIENCY EXAMINATION

COMPUTER SCIENCE

PRACTICE PAPER

UNIT 1 – FUNDAMENTALS OF COMPUTER SCIENCE

PAPER 01

1 ½ hours

INSTRUCTIONS TO CANDIDATES

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

2. Answer ALL questions.

Page 2: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 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 a

relational database can be BEST categorised as a

(a) 1 GL

(b) 2 GL

(c) 4 GL

(d) 5 GL

Item 4 refers to the following information.

Two students James and Richard wrote programs to solve a simple task. Each student’s 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 the

program. The languages used is known as a

(a) 1st generation programming language

(b) 2nd generation programming language

(c) 3rd generation programming language

(d) 4th generation programming language

Page 3: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 3 ~

GO ON TO THE NEXT PAGE

6. Joe wants to teach his little sister, Mary, about programming, but Mary is impatient and wants

to 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 integer

and 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 computer’s word size is the

(a) length of an instruction

(b) maximum number of characters in a typed word

(c) storage capacity of the computer’s memory

(d) number of bits that the CPU can manipulate at one time

Page 4: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 4 ~

GO ON TO THE NEXT PAGE

11. The 8-bit two’s 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 I – VI 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

Page 5: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 5 ~

GO ON TO THE NEXT PAGE

Items 16 – 17 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

Page 6: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 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 = r – 1

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 ‘C

programming is fun’?

#include <stdio.h>

,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

Page 7: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 7 ~

GO ON TO THE NEXT PAGE

Item 24 refers to the following algorithm

#include <stdio.h>

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<stdio.h>

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\n

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

Page 8: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 8 ~

GO ON TO THE NEXT PAGE

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

stages 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<stdio.h>

#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<SIZE; k++)

printf(“%d”, table*k+);

(b) for(k=0; k<SIZE; k--)

printf(“%d”, table*k+);

(c) for(k=0; k<SIZE; k--)

Scanf(“%d”, table*k+);

(d) for(k=0; k<SIZE; k++)

scanf(“%d”, table*k+);

29. After compiling a program written in a high level language

(a) it must be interpreted before it can run on the CPU

(b) it must be converted to decimal before it can be run on the CPU

(c) it can run on the CPU immediately after compilation

(d) it must be re-compiled to a low level language then run on the CPU

30. In Computer Science, volatility refers to memory that

(a) retains its data when power is turned off

(b) looses its data when power is turned off

(c) retains its data when power is on

(d) looses its data when power is turned on

Page 9: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 9 ~

GO ON TO THE NEXT PAGE

31. Many banks use ATM’s 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 being

expressed 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

Page 10: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

~ 10 ~

GO ON TO THE NEXT PAGE

Item 36 – 37 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 0’s

I For j= 1 to 6

II arr[num] = arr[num]+1

III 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)

Page 11: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

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 student’s program

runs 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 table

A 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

Page 12: CAPE Computer Science Unit 1 Paper 1 - Practice Paper

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