Sunteți pe pagina 1din 13

2002-CE

COMP STUD

PAPER II

HONG KONG EXAMINATION AND ASSESSMENT AUTHORITY


HONG KONG CERTIFICATE OF EDUCATION EXAMINATION 2002

COMPUTER STUDIES PAPER 2 (C Version)


Question Book

11:15 am – 12:15 am (1 hour)

Instructions:

1. Read carefully the instructions on the Answer Sheet and insert the information required (including the
Subject Code) in the spaces provided.

2. When told to open this book, you should check that all questions are there. Look for the words ‘END OF
PAPER’ after the last question.

3. All questions carry equal marks.

4. ANSWER ALL QUESTIONS. You should mark all your answers on the Answer Sheet.

5. You should mark only ONE answer for each question. If you mark more than one answer, you will
receive NO MARKS for that question.

6. No marks will be deducted for wrong answers.

2002-CE-COMP STUD 2-1 (C Version)


There are 50 questions in this paper. Choose the most A. teleconferencing
suitable answer. B. electronic mail
C. dialup network
D. video on demand
1. Which of the following are commonly used in human-like
robots? 7. Below is part of a file MEMBER:

(1) artificial intelligence name class student number membership expiry date
Chan Tai Man 1A 15687 14/7/2003
(2) image recognition Wong Li Li 2B 35984 15/7/2004
(3) computer programming … … … …
(4) speech synthesis If MEMBER is to be updated using a transaction file
A. (2) and (4) only TRANS, which of the following fields must be included
B. (1), (2) and (3) only in TRANS?
C. (1), (3) and (4) only
D. (1), (2), (3) and (4) A. name
B. class
2. Which of the following is/are example(s) of an electronic C. student number
funds transfer system? D. membership expiry date

(1) an electronic payroll transfer system 8. Which of the following is/are data verification?
(2) an electronic inventory system
(3) an automatic teller machine (1) checking if the data is mistyped
A. (1) only (2) entering data twice by two different
B. (1) and (2) only operators
C. (2) and (3) only (3) checking if the data is reasonable
D. (1) and (3) only (4) printing a hard copy for checking
against the original data
3. Which of the following is NOT a use of computers in the A. (3) only
farming industry? B. (1) and (2) only
C. (1), (2) and (4) only
A. retrieving weather information D. (1), (3) and (4) only
B. selling products through the Internet
C. replacing all staff on farms 9. Computer file protection and security involve
D. monitoring machines on farms
(1) backup up files
4. In a hospital, can help doctors diagnose (2) putting backing store that holds files in
patients’ illness. a safe place
(3) keeping hard copies of files
A. a robot (4) setting up a password system
B. an expert system A. (1) and (2) only
C. an electronic funds transfer system B. (1), (2) and (4) only
D. a computer assisted instruction system C. (1), (3) and (4) only
D. (2), (3) and (4) only
5. Which of the following are disadvantages of having a
computer network in a school? 10. Which of the following can be done to protect against
data loss from hard disk failure?
(1) Data may be accessed by unauthorized
persons. A. data encryption
(2) Computer viruses may spread more B. read-only access control
easily. C. password protection
(3) File sharing is possible. D. file back-up and file generation
(4) A computer network requires two or
more computers. 11. Which of the following is a characteristic of a multi-
A. (1) and (2) only tasking system?
B. (2) and (3) only
C. (3) and (4) only A. It must be a multi-user system.
D. (1) and (4) only B. It allows a user to run several programs at the same time.
C. It must be an off-line system.
6. In a school, a computer teacher stores educational TV D. It requires a user’s immediate response.
programmes in a server. Students can choose any of the
programmes to watch on the computers in a multimedia 12. ‘A data processing method whose input and output are
learning centre. interleaved, like a conversation, allows the user’s input to
depend on earlier output from the same run.’
Which of the following best describes the above?
Which of the following best describes this data
2002-CE-COMP STUD 2-2 (C Version)
processing method? affect the number of lines in a document?

A. real-time processing A. changing the margins of the document


B. on-line non-interactive processing B. changing the line spacing
C. on-line processing C. changing the justification of the text
D. interactive processing D. underlining the text

13. For a Sports Day, a file is used to store information about 18. Which of the following files can be attached to electronic
participating students and the events. Which of the mail?
following CANNOT be used as the key field?
(1) graphics files
A. Hong Kong Identity Card Number (2) audio files
B. student registration number (3) video files
C. class together with class number A. (1) and (2) only
D. student name together with event B. (1) and (3) only
C. (2) and (3) only
14. Consider the following worksheet in a spreadsheet D. (1), (2) and (3)
package:
19. Which of the following can be used in data
A B communication?
1 Amount 10000
2 Interest Rate 3% (1) twisted-pair wires
3 (2) optical fibres
4 Year Interest (3) microwaves
5 1 300 A. (1) and (2) only
6 2 600 B. (1) and (3) only
Cell B6 stores the product of B1, B2 and A6. If the C. (2) and (3) only
formula stored in cell B6 is produced by copying the D. (1), (2) and (3)
formula stored in cell B5, what should be the formula in
cell B5? 20. Which of the following software is commonly used to
retrieve information on the Internet?
(A $ sign before any column letters or row numbers
represents absolute addressing. Without the $ sign, A. a browser
B. a word processing package
relative addressing is used.)
C. a spreadsheet package
B1*B2*A$5 D. a graphics package
A.
B. B$1*B$2*A5
$B1*$B2*A5 21. Mary has produced the following picture using a graphics
C.
B1*B2*$A5 package.
D.

15. Which of the following are advantages of using electronic


spreadsheets over manual spreadsheets?

(1) Data format can be changed more easily.


(2) Chart can be drawn more easily.
(3) Calculation can be performed faster.
A. (1) and (3) only
Which of the following drawing tool functions is the
B. (1) and (2) only
LEAST useful in producing the picture?
C. (2) and (3) only
D. (1), (2) and (3)
A. fill colour
B. copy and paste
16. Which of the following are usually required to access the
C. flip lines
Internet at home?
D. lines
(1) an Internet Service Provider (ISP)
account
(2) an electronic mail account
(3) a modem
(4) a search engine
A. (1) and (3) only
B. (1) and (4) only
C. (2) and (3) only
D. (2) and (4) only

17. In using a word processor, which of the following may

2002-CE-COMP STUD 2-3 (C Version)


22. P, Q, R and S are working in a company. Q, R and S want 28. Mr. Cheung has found a good passage in a textbook. He
to know what is in P’s electronic mail account. One day, wants to make a copy for reference using a computer. He
they did the following: needs a and a printer.

(1) Q stole P’s electronic mail account A. scanner


password. B. bar code reader
(2) R logged into P’s electronic mail account. C. touch screen
(3) S read the mail in P’s electronic mail D. graph plotter
account.
Who has/have probably committed a computer crime? 29. David is unable to delete a file in a directory on a hard
disk. Which of the following is a possible reason?
A. Q only
B. Q and S only A. The file is in use.
C. Q and R only B. The hard disk is full.
D. Q, R and S C. There is another copy of the file in another
directory.
23. Peter is a in an office. He provides first-hand D. The file size is very small.
support to staff for problems in operating computers.
30. What are two bytes used to represent a Chinese
A. computer technician character?
B. programmer
C. system analyst A. Most Chinese characters are composed of two
D. network manager parts.
B. The display size of a Chinese character on
24. Which of the following statements is INCORRECT? screen is usually twice that of an alphanumeric
character.
A. Random access memory (RAM) is volatile and C. Two bytes have sufficient combinations to
so we need backing store to hold data represent all Chinese characters.
permanently. D. Some Chinese applications software is designed
B. Main memory is more costly than backing for 16-bit computers.
store.
C. Read only memory (ROM) has to hold user 31. In a certain computer system, each integer is stored in 6
programs so that the programs can be executed bits using sign-and-magnitude representation. The range
faster. of the integers that can be stored is from .
D. Random access memory (RAM) can hold user
programs so that the programs can be executed A. -6 to 6
faster. B. -31 to 31
C. -32 to 31
25. Which of the following devices is used to read data on a D. -32 to 32
credit card?
32. Which of the following can be executed directly by the
A. a magnetic ink character reader CPU of a computer?
B. a magnetic strip card reader
C. a bar code reader A. a Pascal program
D. an image scanner B. a BASIC program
C. a machine code program
26. Which of the following is the correct order of categories D. an assembly language program
of computers from the highest computing power to the
lowest? 33. Which of the following about a compiler and an
assembler is correct?
A. Supercomputer, Mainframe computer, Palm
computer, Microcomputer A. They both take equal time to translate a
B. Microcomputer, Minicomputer, Mainframe program.
computer, Supercomputer B. They both translate high level language
C. Supercomputer, Mainframe computer, programs into machine code programs.
Microcomputer, Palm computer C. They both generate a machine code program at
D. Mainframe computer, Microcomputer, Palm the end of translation.
computer, Minicomputer D. They both translate one instruction at a time as
the program is executed.
27. The main function of a Control Unit is to .

A. perform arithmetic operations


B. send out control signals
C. perform logic operations
D. store data
2002-CE-COMP STUD 2-4 (C Version)
A. 3
34. The following diagram shows a computer operation B. 5
C. 8
CPU Memory Unit D. 32

PC X 38. Below is an algorithm to swap the values stored in the


Register X represents . variables A and B.

A. ACC Step 1: assign the value of (A + B) to A


B. IR Step 2: assign the value of (A - B) to B
C. MAR Step 3: assign the value of (A - B) to A
D. MDR Which of the following is a limitation of the above
algorithm?
35. Which of the following is a reason for using mnemonics
to represent machine instruction? A. The values stored in variables A and B must not
be zero.
A. Programmers can understand the program more B. The values stored in variables A and B must not
easily. be of the string data type.
B. The program runs faster. C. A must be larger than B.
C. There are fewer instructions in the program. D. B must be larger than A.
D. The program can be executed directly by the
computer. 39. Which of the following is NOT an advantage of using the
modular approach in writing a large program?
36. Which of the following about an operating system is
INCORRECT? A. It allows a team of programmers to work
together in writing the program.
A. It is responsible for resource allocation of a B. Modules can be reused in other programs.
computer system C. It is easier to modify and debug the program.
B. It is an interface between a computer and its D. There are fewer lines in the program.
user.
C. It can handle errors. 40. Which of the following about program documentation is
D. A word processing package is an example of an INCORRECT?
operating system.
A. It aims to make the program easier to
37. In a simple model computer, each instruction consists of a understand.
3-bit operation code and a 5-bit operand. What is the B. It helps programmers modify the program in
maximum possible number of operation codes in the order to meet users’ changing requirements.
computer? C. It is completed before program coding.
D. It involves meaningful identifier names and
descriptive comments.

2002-CE-COMP STUD 2-5 (C Version)


For questions 41-50, find the output of the given program.

41. #include <stdio.h>


#include <math.h>

int main()
{
int x, y, z;

x = abs(-10.5);
y = 11 % 4;
z = x / 6 * y;
printf("%d\n", z);
}

A. -2
B. 1
C. 2
D. 3

42. #include <stdio.h>

int main()
{
int N, X;
FILE* infile;

infile = fopen("sample.txt", "r");


N = 0;
while ( !feof(infile) )
{
N++;
fscanf(infile, "%d", &X);
}
fclose(infile);
printf("%d\n", N);
}

The contents of the file ‘sample.txt’ is as follows:


7 2 6 12 33 100 255 17<eof>
<eof> represents the end-of-file character.

A. 7
B. 8
C. 9
D. 17

2002-CE-COMP STUD 2-6 (C Version)


43. #include <stdio.h>

int main()
{
char st1[80], st2[80], st3[80];
int i;

strcpy(st1, "PQRST");
strcpy(st2, "123");
strcpy(st3, st1);
strcat(st3, st2);
strncpy(st1, st3 + strlen(st1) - 1, strlen(st2));
st1[strlen(st2)] = '\0';
printf("%s\n", st1);
}

A. ST123
B. RST12
C. T12
D. 123

44. #include <stdio.h>

int main()
{
int sum, k, m;

sum = 0;
for ( k = 4; k >= 1; k-- )
for ( m = 1; m <= 5 - k; m++ )
sum = sum + 1;
printf("%d\n", sum);
}

A. 5
B. 10
C. 15
D. 20

45. #include <stdio.h>

int main()
{
int x, y, z;

x = 1;
y = 2;
z = 3;
if ( x >= y || y <= z )
{
x = y + z;
y = x + y;
}
else
{
x = y - z;
y = x - y;
}
printf("%d%4d\n", x, y);
}

A. 1 2
B. 5 7
C. -1 -3
D. 5 3

2002-CE-COMP STUD 2-7 (C Version)


46. #include <stdio.h>

int main()
{
int i, j, target;
int N[10];

N[0] = 1;
for ( i = 1; i < 10; i++ )
N[i] = N[i - 1] + 5;
j = -1;
target = 20;
do
j++;
while ( !(target <= N[j]) );
printf("%d\n", j);
}

A. 3
B. 4
C. 5
D. 6

47. #include <stdio.h>

int main()
{
int col, row;
int x[4][5];

for ( col = 0; col < 4; col++ )


for ( row = 0; row < 5; row++ )
{
x[col][row] = row;
switch ( col )
{
case 1:
x[col][row] *= 2;
break;
case 2:
x[col][row] *= 3;
break;
case 3:
x[col][row] *= 4;
break;
}
}
printf("%d%3d%3d%3d\n", x[0][1], x[1][2], x[2][3], x[3][4]);
}

A. 1 2 3 4
B. 2 4 6 8
C. 3 6 9 12
D. 1 4 9 16

2002-CE-COMP STUD 2-8 (C Version)


48. #include <stdio.h>

void S(int p)
{
p = 1;
printf("%d", p);
}

int main()
{
int i;

i = 2;
printf("%d", i);
S(i);
printf("%d\n", i);
}

A. 211
B. 212
C. 221
D. 222

49. #include <stdio.h>

int main()
{
int x, y;

x = 2;
y = 5;
if ( x < 1 )
if ( y > 4 )
x = x - y;
else
x = x - 3;
else
if ( y > 4 )
x = x * 4;
else
x = x + 2;
printf("%d\n", x);
}

A. -3
B. 2
C. 8
D. 4

2002-CE-COMP STUD 2-9 (C Version)


50. #include <stdio.h>

int main()
{
int x, y;
int flag;

x = 7;
y = 1;
flag = true;
while ( x > 0 && flag )
{
x = x - 2;
y = y + 1;
flag = x > y;
}
printf("%2d%2d\n", x, y);
}

A. 3 3
B. 1 4
C. 0 5
D. -1 5

2002-CE-COMP STUD 2-10 (C Version)


A Partial Character List for ASCII

Character ASCII Character ASCII Character ASCII


0 48 J 74 d 100
1 49 K 75 e 101
2 50 L 76 f 102
3 51 M 77 g 103
4 52 N 78 h 104
5 53 O 79 I 105
6 54 P 80 j 106
7 55 Q 81 k 107
8 56 R 82 l 108
9 57 S 83 m 109
: 58 T 84 n 110
; 59 U 85 o 111
< 60 V 86 p 112
= 61 W 87 q 113
> 62 X 88 r 114
? 63 Y 89 s 115
@ 64 Z 90 t 116
A 65 [ 91 u 117
B 66 \ 92 v 118
C 67 ] 93 w 119
D 68 ^ 94 x 120
E 69 _ 95 y 121
F 70 ` 96 z 122
G 71 a 97 { 123
H 72 b 98 | 124
I 73 c 99 } 125

List of Operators and Reserved Words (C)

#include, +, -, *, /, ++, --, +=, -=, *=, /=, %=, ==, %, >, <, =, >=, <=, !=, &&, ||, !, sqrt, rand, abs, strcat, strncat, strlen,
atoi, strcpy, strncpy, const, void, return, int, float, char, \0, strcmp, strncmp, true, false, FILE, main, /*…*/, if…else, for,
while, do…while, switch…case…break, break, continue, scanf, printf (%d, %f, %c, %s), \n, \t, fopen, getc, fgets, putc,
fputs, EOF, fclose

2002-CE-COMP STUD 2-11 (C Version)


Appendix

Lists of Commands in Mnemonics

Op-code Operand Meaning


INP XXX input data to address XXX
OUT XXX output the contents of address XXX
STA XXX store the contents of accumulator to address XXX
LDA XXX load accumulator with the contents of address XXX
JMP XXX jump to address XXX
JPN XXX branch to address XXX if the contents of accumulator are negative
JPZ XXX branch to address XXX if the contents of accumulator are zero
INC XXX increase the contents of address XXX by 1
DEC XXX decrease the contents of address XXX by 1
ADD XXX add to accumulator the contents of address XXX and store the result in
accumulator
SUB XXX subtract from accumulator the contents of address XXX and store the result
in accumulator
STP - stop

2002-CE-COMP STUD 2-12 (C Version)


Question No. Key Question No. Key

1. D (69) 26. C (83)


2. D (64) 27. B (78)
3. C (68) 28. A (98)
4. B (67) 29. A (82)
5. A (85) 30. C (58)

6. D (76) 31. B (46)


7. C (79) 32. C (83)
8. C (41) 33. C (59)
9. B (64) 34. C (58)
10. D (84) 35. A (71)

11. B (86) 36. D (60)


12. D (66) 37. C (64)
13. D (77) 38. B (72)
14. B (43) 39. D (53)
15. D (79) 40. C (60)

16. A (85) 41. D (77)


17. A (51) 42. B (61)
18. D (85) 43. C (71)
19. D (75) 44. B (69)
20. A (90) 45. B (65)

21. C (70) 46. B (61)


22. D (77) 47. D (67)
23. A (73) 48. B (64)
24. C (62) 49. C (81)
25. B (88) 50. A (66)

Note: Figures in brackets indicate the percentage of candidates choosing the correct answers.

2002-CE-COMP STUD 2-13 (C Version)

S-ar putea să vă placă și