You are on page 1of 15

2004-CE

COMP STUD

PAPER II

HONG KONG EXAMINATION AND ASSESSMENT AUTHORITY


HONG KONG CERTIFICATE OF EDUCATION EXAMINATION 2004

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.

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


There are 50 questions in this paper. Choose the most suitable answer.

1. Which of the following is an example of an embedded system?

A. a mobile phone
B. a graphics tablet
C. a dictionary in a compact disc with videos and sound recorded
D. a desktop computer

2. Which of the following is the main purpose of using an expert system?

A. to train a user to become an expert


B. to decrease the workload of experts
C. to replace experts
D. to help make decisions

3. Which of the following statements about electronic fund transfer systems is not correct?

A. More paperwork is required in transactions.


B. People are not required to wait in a queue to pay bills.
C. People are not required to carry bulky coins.
D. More computer professionals are required to maintain the system.

4. Peter finds that whenever it is raining or there is a storm, his Internet access at home becomes unstable. Which of the
following communication media will cause this problem?

A. the coaxial cable


B. the optical fibre
C. the telephone line
D. the microwaves

5. Mr. Lee wants to discuss a project with his overseas business partners. Which of the following is most helpful for him to
communicate with his partners?

A. video on demand
B. a search engine
C. teleconferencing
D. file sharing

6. Which of the following is/are the advantage(s) of direct access over sequential access?

(1) Data can be stored in magnetic disks.


(2) A huge amount of backup can be created more efficiently.
(3) Data can be searched faster.
A. (1) only
B. (3) only
C. (1) and (2) only
D. (2) and (3) only

2004-CE-COMP STUD 2-2 (C Version)


7. Peter creates a database file with a record. Its structure is shown below:

File name Type Size (bytes)


NAME character 5
AMOUNT integer 2
Then he amends the contents of the record as follows:

NAME AMOUNT is amended to NAME AMOUNT


JACK 10000 JACKY 80
What will be the change of the file size?

A. an increase of 1 byte
B. no change
C. a decrease of 1 byte
D. a decrease of 2 bytes

8. A user uses a computer to edit a document file and download a file from the Internet at the same time. What is the operating
mode of the computer?

A. multi-user
B. batch processing
C. multitasking
D. interactive processing

9. After changing an application in a computer system from batch processing to real-time processing, what will the effect be?

(1) The response time of the application will be faster


(2) The computer system will have a higher cost
(3) The application will be easier to use.
A. (1) only
B. (1) and (2) only
C. (1) and (3) only
D. (2) and (3) only

10. Amy types the following worksheet in a spreadsheet package:

A B C D E
1 Item 1 Item 2 Item 3 Total amount
2 March 1,000 1,500 800
3 April 1,200 1,100 1,000
4 May 1,300 1,200 750
5
She wants to find the total amount of items 1, 2 and 3 in each month. She types a formula in cell E2 and then copies it into
cells E3 and E4. Which of the following formulae does she type?

A. =SUM(B$2+C$2+D$2)
B. =SUM($B2:$B4)
C. =SUM($B2:$D2)
D. =SUM(B$2:D$2)

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


11. Consider the following database file with two fields, CODE and ITEM, and five records.

CODE ITEM
1 A mouse
2 B keypad
3 CD printer
4 5 tablet
5 B scanner
CODE cannot be used as a key field because .

A. CODE in the third record has two characters, which is not the same as others
B. it is more than 1 byte wide
C. the contents of CODE in the second and fifth records are the same
D. the content of CODE in the fourth record is not alphabet

12. Peter and Mary use search engines to find the same information. They end up with different search results. Why?

(1) They use different search engines.


(2) They use different Internet service providers.
(3) They search at different times.
(4) They use different browsers.
A. (1) and (2) only
B. (1) and (3) only
C. (2) and (3) only
D. (2) and (4) only

13. Mr. Ng sends an email to Ms. Cheung. Later he receives a message from the system administrator saying that the mail server
did not send out his email. Which of the following is/are the possible reason(s)?

(1) The attachment file is too large.


(2) The email address is owned by someone else.
(3) Only a blank character is entered in the email.
A. (1) only
B. (2) only
C. (1) and (3) only
D. (2) and (3) only

14. Three figures produced by a graphics package are given below:

If only these three figures are used, which of the following figures cannot be made without resizing the figures or inserting
any new figures?

A. B. C. D.

2004-CE-COMP STUD 2-4 (C Version)


15. A company uses WAN instead of LAN to connect its computer because .

A. the data communication between the computers will be used frequently


B. the data transfer rate needs to be higher than 6M bits per second
C. the computers are located worldwide
D. a supercomputer has been installed as a server in the main office

16. A company allows users to download its four software programs P, Q, R and S for free. Users are allowed to use P on a trial
basis, Q with an expiring date, R with limited program functions and S with source code provided for modification. Which
software program is not a shareware program?

A. P
B. Q
C. R
D. S

17. Peter finds that his computer is infected by a computer virus after doing the following actions.

Which of the following actions are most likely to have caused this infection?

(1) Accessing a file stored on a floppy disk given to him by his classmate
(2) Downloading and installing a game from the Internet
(3) Changing the wallpaper of the screen
(4) Opening a text file attached to an email
A. (1) and (2) only
B. (2) and (3) only
C. (3) and (4) only
D. (1) and (4) only

18. The main purpose of implementing a password system for logging onto computer systems is to protect the computers from
.

A. system failure
B. computer viruses
C. anonymous emails
D. unauthorized access

19. In order to protect personal data on the Internet, which of the following actions is most appropriate?

A. Frequently updating the anti-virus software in your personal computer


B. Avoiding sending personal data without encryption
C. Avoiding using your real name on the Internet under any circumstances
D. Frequently changing the password of your personal email account

20. Which of the following is not a computer crime?

A. Purchasing a legal software package and creating copies for friends to try
B. Accessing a computer system without authorization but not viewing or deleting any files
C. Distributing a large amount of different freeware to friends
D. Converting a legal musical CD into musical files and sharing them on the web

21. works closely with users to evaluate their requirements and to design new information systems for them.

A. A programmer
B. A network administrator
C. A computer technician
D. A system analyst

22. Which of the following statements is correct?

A. The computational power of minicomputers is higher than that of microcomputers.


B. Desktop computers are physically larger than minicomputers.
C. Supercomputers are usually used in money transactions such as a point-of-sale system.
D. Notebook computers weigh less than personal digital assistants (PDA).

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


23. Which of the following are the major criteria to classify computers?

(1) physical size


(2) processing speed
(3) feasibility to be upgraded
(4) size of RAM
A. (1) and (2) only
B. (1) and (3) only
C. (2) and (4) only
D. (3) and (4) only

24. When the ROM is damaged, the computer

A. cannot boot up
B. needs to have its battery replaced
C. can still work if the hard disk is formatted
D. can still work if the size of the RAM is enough

25. Which of the following benefits most from adding one or more CPUs in a personal computer?

A. printing documents
B. copying files to a compact disc rewritable (CDRW).
C. sorting records in a database
D. surfing the Internet

26. Which of the following are the advantages of using a bar code reader over a keyboard to input data?

(1) It is more accurate.


(2) It is faster.
(3) It has better security.
(4) It has a lower hardware cost.
A. (1) and (2) only
B. (1) and (4) only
C. (2) and (4) only
D. (1), (2) and (3) only

27. In a university, there are many computer networks. Every workstation in each network has a unique 12-bit code as shown
below:

The first 5 bits of the code are used ot identify the networks while the other 7 bits are used to identify the workstations. How
many networks in the university and workstations in each network can the coding method represent?

network workstation
A. 5 7
B. 16 64
C. 31 127
D. 32 128

28. Suppose that n bits are used to represent integers by two’s complement method. If one additional bit (i.e. n+1 bits) is used,
which of the following statements is correct?

A. The largest positive number is increased by 1.


B. The largest positive number is doubled.
C. The smallest negative number is decreased by 1.
D. The smallest negative number is doubled.

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


29. Which of the following errors may occur when floating-point representation is used to store numbers in a computer?

(1) syntax errors


(2) overflow errors
(3) logical errors
(4) truncation errors
A. (1) and (2) only
B. (1) and (3) only
C. (2) and (4) only
D. (3) and (4) only

30. An operator inputs ‘5 KA 2’ instead of ‘NG KA YI’ in a name field. Which of the following methods can detect this error?

A. Type check
B. Presence check
C. Length check
D. Check sum

31. Generally, how many bytes are required to store the following 17 characters in plain text?

電腦科+資訊科技=電腦與資訊科技科

A. 17
B. 19
C. 32
D. 34

32. Which of the following statements about assemblers, compilers and interpreters is correct?

A. Assemblers translate source programs into machine codes while the other two do not.
B. Assemblers are used in old computer models while the other two are not.
C. Interpreters translate each line of a source program into one machine code instruction.
D. Compilers translate the whole program before program execution.

33. Under normal circumstances, when liquid crystal display (LCD) monitors are compared with cathode ray tube (CRT)
monitors, which of the following statements are correct?

(1) LCD monitors are cheaper.


(2) LCD monitors weigh less.
(3) LCD monitors consume less electricity.
(4) LCD monitors display more colours.
A. (1) and (2) only
B. (2) and (3) only
C. (2) and (4) only
D. (3) and (4) only

34. Which of the following registers mainly assist the computation of ALU?

(1) the Status Register


(2) the Accumulator
(3) the Program Counter
A. (1) and (2) only
B. (2) and (3) only
C. (1) and (3) only
D. (1), (2) and (3)

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


35. Which of the following is/are the reason(s) for creating different directories in a file system?

(1) To save hard disk storage space.


(2) To help users to handle files.
(3) To increase processing speed of the CPU.
A. (1) only
B. (2) only
C. (3) only
D. (1) and (3) only

36. Referring to the Appendix (List of Commands in Mnemonics), which of the following will be the last register involved in the
execution of the instruction ADD 1000 ?

A. ACC
B. MDR
C. MAR
D. IR

37. A programmer has written a program to computer and print a credit card monthly statement. The programmer finds that the
total amount is not equal to the sum of all individual amounts on the statement. Which of the following errors has/have
happened?

(1) a logical error


(2) a syntax error
(3) a run-time error
A. (1) only
B. (2) only
C. (3) only
D. (1) and (2) only

38. Which of the following is/are the reason(s) for using a graphical user interface in an operating system?

(1) The system is user-friendly


(2) It does not require users to memorize commands.
(3) The system responds faster.
A. (1) only
B. (3) only
C. (1) and (2) only
D. (2) and (3) only

39. Mary develops a program and uploads its source code and object program onto her website. She expects that many people are
able to modify the program for their own use. Which of the following types of programming languages and translators are the
most suitable to develop this program?

A. a high level language and a compiler


B. a high level language and an interpreter
C. a low level language and an assembler
D. a low level language and an interpreter

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


40. Consider the following example of pseudocode:

Do while not end of file


Read a student record
Calculate the total mark
Print output result
End do
Which of the following statements about this pseudocode are correct?

(1) The pseudocode is used to express an algorithm.


(2) Each line is rewritten into one program statement.
(3) The second, third and fourth lines are indented to improve the readability.
(4) Pseudocode is a high level programming language and can be translated by a compiler or interpreter only.
A. (1) and (2) only
B. (1) and (3) only
C. (3) and (4) only
D. (2), (3) and (4) only

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

41. int main()


{
int a[5];
int x;

x = 1;
a[0] = 4;
do
{
a[x] = a[x - 1] + x;
x = x + 1;
}
while ( x < 5 );
printf("%d\n", a[4]);
}

A. 10
B. 14
C. 18
D. 19

42. int main()


{
int a, b;

a = 18 % 4;
b = 200 / 6;
printf("%d", a + b / 5);
}

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

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


43. int main()
{
char x[80], s[80];
int i;

strcpy(x, "0");
for ( i = 1; i <= 20; i++ )
{
sprintf(s, "%d", i);
strcat(x, s);
}
printf("%d\n", strlen(x));
}

A. 30
B. 31
C. 32
D. 33

44. int main()


{
char s[80], t[80], tmp[80];
int n, k;

strcpy(s, "ABCDEFGHIJ");
strcpy(t, "");
n = strlen(s) / 2;
for ( k = 0; k < n; k++ )
{
strncpy(tmp, s + k, k + 1);
tmp[k + 1] = '\0';
strcat(t, tmp);
}
printf("%s\n", t);
}

A. ABCDE
B. ABCDEFGHIJ
C. AABABCABCDABCDE
D. ABCCDEDEFGEFGHI

45. void func(int x, int* y)


{
x = *y;
*y = x;
}

int main()
{
int a, b;

a = 5;
b = 10;
func(a, &b);
printf("%d %d\n", a, b);
}

A. 5 5
B. 5 10
C. 10 5
D. 10 10

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


46. int main()
{
int x, y;

for ( x = 1; x <= 7; x++ )


if ( (x % 3) == 0 )
for ( y = 1; y <= x; y++ )
printf("*");
else
for ( y = 1; y <= x; y++ )
printf("+");
}

A. ***+++***+++***+++***
B. +++***+++***+++***+++
C. ***+++*********++++++*******
D. +++***+++++++++******+++++++

47. int main()


{
int x, y, z;

z = 0;
for ( x = 1; x <= 10; x++ )
for ( y = x; y >= 0; y-- )
if ( x + y == 4 )
z++;
printf("%d\n", z);
}

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

48. int main()


{
int x, y;

x = 0;
y = 0;
while ( x <= 13 && !(y == 16) )
{
y = x + y;
x += 2;
}
printf("%d\n", y);
}

A. 0
B. 30
C. 42
D. 56

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


49. int main()
{
FILE* infile;
char ch;
int N;

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


N = 0;
while ( !feof(infile) )
{
fscanf(infile, "%c", &ch);
if ( (int) ch >= 65 && (int) ch <= 90 )
N++;
}
printf("%d\n", N);
fclose(infile);
}

The content of the file ‘einstein.txt’ is shown below:

Before God we are all equally wise – and equally foolish.


- Albert Einstein
<eof>
<eof> represents the end-of-file character.

A. 0
B. 1
C. 2
D. 4

50. (Not available in C version)

2004-CE-COMP STUD 2-12 (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

2004-CE-COMP STUD 2-13 (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

2004-CE-COMP STUD 2-14 (C Version)


Question No. Key Question No. Key

1. A (38) 26. A (61)


2. D (62) 27. D (54)
3. A (82) 28. D (37)
4. D (63) 29. C (72)
5. C (71) 30. A (81)

6. B (54) 31. C (58)


7. B (56) 32. D (56)
8. C (81) 33. B (50)
9. B (74) 34. A (51)
10. C (68) 35. B (84)

11. C (83) 36. A (64)


12. B (71) 37. A (39)
13. A (61) 38. C (71)
14. C (79) 39. A (52)
15. C (69) 40. B (27)

16. D (53) 41. B (71)


17. A (64) 42. B (71)
18. D (92) 43. C (52)
19. B (54) 44. D (60)
20. C (75) 45. B (46)

21. D (56) 46. D (71)


22. A (63) 47. B (58)
23. A (43) 48. C (54)
24. A (59) 49. D (51)
25. C (63) 50. B (45)

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

2004-CE-COMP STUD 2-15 (C Version)

You might also like