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 suitable answer. 1.
Which of the following are commonly used in human-like robots?
A. B. C. D. 2.
(1) an electronic payroll transfer system (2) an electronic inventory system (3) an automatic teller machine (1) only (1) and (2) only (2) and (3) only (1) and (3) only
retrieving weather information selling products through the Internet replacing all staff on farms monitoring machines on farms
In a hospital, patients’ illness. A. B. C. D.
5.
(1) artificial intelligence (2) image recognition (3) computer programming (4) speech synthesis (2) and (4) only (1), (2) and (3) only (1), (3) and (4) only (1), (2), (3) and (4)
Below is part of a file MEMBER:
A. B. C. D. 8.
student number 15687 35984 …
membership expiry date 14/7/2003 15/7/2004 …
name class student number membership expiry date
Which of the following is/are data verification? (1) (2)
A. B. C. D. 9.
checking if the data is mistyped entering data twice by two different operators (3) checking if the data is reasonable (4) printing a hard copy for checking against the original data (3) only (1) and (2) only (1), (2) and (4) only (1), (3) and (4) only
Computer file protection and security involve (1) (2)
a robot an expert system an electronic funds transfer system a computer assisted instruction system
A. B. C. D. 10.
backup up files putting backing store that holds files in a safe place (3) keeping hard copies of files (4) setting up a password system (1) and (2) only (1), (2) and (4) only (1), (3) and (4) only (2), (3) and (4) only
Which of the following can be done to protect against data loss from hard disk failure?
(1)
A. B. C. D. 6.
Data may be accessed by unauthorized persons. (2) Computer viruses may spread more easily. (3) File sharing is possible. (4) A computer network requires two or more computers. (1) and (2) only (2) and (3) only (3) and (4) only (1) and (4) only
class 1A 2B …
If MEMBER is to be updated using a transaction file TRANS, which of the following fields must be included in TRANS?
can help doctors diagnose
Which of the following are disadvantages of having a computer network in a school?
teleconferencing electronic mail dialup network video on demand
name Chan Tai Man Wong Li Li …
Which of the following is NOT a use of computers in the farming industry? A. B. C. D.
4.
7.
Which of the following is/are example(s) of an electronic funds transfer system?
A. B. C. D. 3.
A. B. C. D.
In a school, a computer teacher stores educational TV programmes in a server. Students can choose any of the programmes to watch on the computers in a multimedia learning centre.
A. B. C. D. 11.
Which of the following is a characteristic of a multitasking system? A. B. C. D.
12.
data encryption read-only access control password protection file back-up and file generation
It must be a multi-user system. It allows a user to run several programs at the same time. It must be an off-line system. It requires a user’s immediate response.
‘A data processing method whose input and output are 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? A. B. C. D. 13.
real-time processing on-line non-interactive processing on-line processing interactive processing
For a Sports Day, a file is used to store information about participating students and the events. Which of the following CANNOT be used as the key field? A. B. C. D.
14.
affect the number of lines in a document? A. B. C. D. 18.
Hong Kong Identity Card Number student registration number class together with class number student name together with event
19. A Amount Interest Rate
B 10000 3%
1 2 3 4 Year Interest 5 1 300 6 2 600 Cell B6 stores the product of B1, B2 and A6. If the formula stored in cell B6 is produced by copying the formula stored in cell B5, what should be the formula in cell B5?
20.
15.
(1) Data format can be changed more easily. (2) Chart can be drawn more easily. (3) Calculation can be performed faster. (1) and (3) only (1) and (2) only (2) and (3) only (1), (2) and (3)
Which of the following are usually required to access the Internet at home? (1)
A. B. C. D. 17.
Which of the following software is commonly used to retrieve information on the Internet? A. B. C. D.
21.
(1) twisted-pair wires (2) optical fibres (3) microwaves (1) and (2) only (1) and (3) only (2) and (3) only (1), (2) and (3)
a browser a word processing package a spreadsheet package a graphics package
Mary has produced the following picture using a graphics package.
Which of the following are advantages of using electronic spreadsheets over manual spreadsheets?
A. B. C. D. 16.
B1*B2*A$5 B$1*B$2*A5 $B1*$B2*A5 B1*B2*$A5
(1) graphics files (2) audio files (3) video files (1) and (2) only (1) and (3) only (2) and (3) only (1), (2) and (3)
Which of the following can be used in data communication?
A. B. C. D.
(A $ sign before any column letters or row numbers represents absolute addressing. Without the $ sign, relative addressing is used.) A. B. C. D.
Which of the following files can be attached to electronic mail?
A. B. C. D.
Consider the following worksheet in a spreadsheet package:
changing the margins of the document changing the line spacing changing the justification of the text underlining the text
an Internet Service Provider (ISP) account (2) an electronic mail account (3) a modem (4) a search engine (1) and (3) only (1) and (4) only (2) and (3) only (2) and (4) only
In using a word processor, which of the following may
2002-CE-COMP STUD 2-3 (C Version)
Which of the following drawing tool functions is the LEAST useful in producing the picture? A. B. C. D.
fill colour copy and paste flip lines lines
22.
P, Q, R and S are working in a company. Q, R and S want to know what is in P’s electronic mail account. One day, they did the following:
28.
A. B. C. D.
(1)
Q stole P’s electronic mail account password. (2) R logged into P’s electronic mail account. (3) S read the mail in P’s electronic mail account. Who has/have probably committed a computer crime? A. B. C. D. 23.
24.
B. C. D.
D. 30.
computer technician programmer system analyst network manager
B. C.
Random access memory (RAM) is volatile and so we need backing store to hold data permanently. Main memory is more costly than backing store. Read only memory (ROM) has to hold user programs so that the programs can be executed faster. Random access memory (RAM) can hold user programs so that the programs can be executed faster.
D. 31.
a magnetic ink character reader a magnetic strip card reader a bar code reader an image scanner
B. C. D.
Supercomputer, Mainframe computer, Palm computer, Microcomputer Microcomputer, Minicomputer, Mainframe computer, Supercomputer Supercomputer, Mainframe computer, Microcomputer, Palm computer Mainframe computer, Microcomputer, Palm computer, Minicomputer
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 Pascal program a BASIC program a machine code program an assembly language program
Which of the following about a compiler and an assembler is correct? A. B. C. D.
.
-6 to 6 -31 to 31 -32 to 31 -32 to 32
Which of the following can be executed directly by the CPU of a computer? A. B. C. D.
33.
Most Chinese characters are composed of two parts. The display size of a Chinese character on screen is usually twice that of an alphanumeric character. Two bytes have sufficient combinations to represent all Chinese characters. Some Chinese applications software is designed for 16-bit computers.
In a certain computer system, each integer is stored in 6 bits using sign-and-magnitude representation. The range of the integers that can be stored is from . A. B. C. D.
32.
The file is in use. The hard disk is full. There is another copy of the file in another directory. The file size is very small.
What are two bytes used to represent a Chinese character? A.
Which of the following is the correct order of categories of computers from the highest computing power to the lowest? A.
27.
A. B. C.
Which of the following devices is used to read data on a credit card? A. B. C. D.
26.
Q only Q and S only Q and R only Q, R and S
scanner bar code reader touch screen graph plotter
David is unable to delete a file in a directory on a hard disk. Which of the following is a possible reason?
Which of the following statements is INCORRECT? A.
25.
29.
Peter is a in an office. He provides first-hand support to staff for problems in operating computers. A. B. C. D.
Mr. Cheung has found a good passage in a textbook. He wants to make a copy for reference using a computer. He needs a and a printer.
They both take equal time to translate a program. They both translate high level language programs into machine code programs. They both generate a machine code program at the end of translation. They both translate one instruction at a time as the program is executed.
34.
CPU
Memory Unit
PC Register X represents A. B. C. D. 35.
B. C. D.
38.
.
Programmers can understand the program more easily. The program runs faster. There are fewer instructions in the program. The program can be executed directly by the computer.
B. C. D.
It is responsible for resource allocation of a computer system It is an interface between a computer and its user. It can handle errors. A word processing package is an example of an operating system.
In a simple model computer, each instruction consists of a 3-bit operation code and a 5-bit operand. What is the maximum possible number of operation codes in the computer?
2002-CE-COMP STUD 2-5 (C Version)
3 5 8 32
Below is an algorithm to swap the values stored in the variables A and B. Step 1: assign the value of (A + B) to A Step 2: assign the value of (A - B) to B Step 3: assign the value of (A - B) to A Which of the following is a limitation of the above algorithm?
ACC IR MAR MDR
A. B. C. D. 39.
Which of the following about an operating system is INCORRECT? A.
37.
X
Which of the following is a reason for using mnemonics to represent machine instruction? A.
36.
A. B. C. D.
The following diagram shows a computer operation
Which of the following is NOT an advantage of using the modular approach in writing a large program? A. B. C. D.
40.
The values stored in variables A and B must not be zero. The values stored in variables A and B must not be of the string data type. A must be larger than B. B must be larger than A.
It allows a team of programmers to work together in writing the program. Modules can be reused in other programs. It is easier to modify and debug the program. There are fewer lines in the program.
Which of the following about program documentation is INCORRECT? A. B. C. D.
It aims to make the program easier to understand. It helps programmers modify the program in order to meet users’ changing requirements. It is completed before program coding. It involves meaningful identifier names and descriptive comments.
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. B. C. D.
42.
-2 1 2 3
#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> A. B. C. D.
7 8 9 17
2002-CE-COMP STUD 2-6 (C Version)
<eof> represents the end-of-file character.
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. B. C. D. 44.
ST123 RST12 T12 123
#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. B. C. D. 45.
5 10 15 20
#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. B. C. D.
1 5 -1 5
2 7 -3 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. B. C. D.
47.
3 4 5 6
#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. B. C. D.
1 2 3 1
2 4 6 4
3 6 9 9
4 8 12 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. B. C. D. 49.
211 212 221 222
#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. B. C. D.
-3 2 8 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. B. C. D.
3 1 0 -1
3 4 5 5
2002-CE-COMP STUD 2-10 (C Version)
A Partial Character List for ASCII Character 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I
ASCII 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
Character J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c
ASCII 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
Character d e f g h I j k l m n o p q r s t u v w x y z { | }
ASCII 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 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 INP OUT STA LDA JMP JPN JPZ INC DEC ADD
Operand XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
SUB
XXX
STP
-
Meaning input data to address XXX output the contents of address XXX store the contents of accumulator to address XXX load accumulator with the contents of address XXX jump to address XXX branch to address XXX if the contents of accumulator are negative branch to address XXX if the contents of accumulator are zero increase the contents of address XXX by 1 decrease the contents of address XXX by 1 add to accumulator the contents of address XXX and store the result in accumulator subtract from accumulator the contents of address XXX and store the result in accumulator stop
2002-CE-COMP STUD 2-12 (C Version)
Question No.
Key
Question No.
Key
1. 2. 3. 4. 5.
D (69) D (64) C (68) B (67) A (85)
26. 27. 28. 29. 30.
C (83) B (78) A (98) A (82) C (58)
6. 7. 8. 9. 10.
D (76) C (79) C (41) B (64) D (84)
31. 32. 33. 34. 35.
B (46) C (83) C (59) C (58) A (71)
11. 12. 13. 14. 15.
B (86) D (66) D (77) B (43) D (79)
36. 37. 38. 39. 40.
D (60) C (64) B (72) D (53) C (60)
16. 17. 18. 19. 20.
A (85) A (51) D (85) D (75) A (90)
41. 42. 43. 44. 45.
D (77) B (61) C (71) B (69) B (65)
21. 22. 23. 24. 25.
C (70) D (77) A (73) C (62) B (88)
46. 47. 48. 49. 50.
B (61) D (67) B (64) C (81) A (66)
Note: Figures in brackets indicate the percentage of candidates choosing the correct answers.
2002-CE-COMP STUD 2-13 (C Version)