2001-CE COMP STUD PAPER II HONG KONG EXAMINATION AND ASSESSMENT AUTHORITY HONG KONG CERTIFICATE OF EDUCATION EXAMINATION 2001
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.
2001-CE-COMP STUD 2-1 (C Version)
There are 50 questions in this paper. 1.
A computer company invites a famous chess player to play chess against a computer with high processing power. This chess game is an application of A. B. C. D.
2.
B. C. D.
computer assisted learning multimedia control system artificial intelligence
7.
purchasing a single-journey train ticket from a vending machine paying a bus fare with a stored-value card purchasing a shirt with a bank card paying a utility bill by autopay
electronic mail printer sharing file transfer newsgroup
8.
D. 9.
range check type check check digit control total
A. B. C. D. 10.
Peter has just finished typing a document using a word processing software. The layout of his document is as follows:
Which of the following formatting functions CANNOT allow Peter to adjust the whole document on one page? A. B. C. D. 6.
change the margins of the page change the font size of the text change the justification of the text change the line spacing
Which of the following must be known in order to retrieve a file from a hard disk? 2001-CE-COMP STUD 2-2 (C Version)
it must be stored in a hard disk. it must be loaded into the main memory. the contents of the main memory must be cleared. the user has to input data using the keyboard.
(1) keyboard (2) visual display unit (3) memory (1) only (2) only (3) only (1) and (2) only
Arrange the following in ascending order of access time.
A. B. C. D. 11.
(1) executable files (2) text files (3) document files (1) only (2) only (1) and (3) only (1), (2) and (3)
Which of the following is/are required to execute a computer program?
Mr Chan has submitted an electronic form for a job application through the Internet. In the fileld “Year of Birth”, he entered the current year.
A. B. C. D.
.
When a program is to be executed, A. B. C.
Which of the following validation checks can detect the error?
5.
Computer viruses can reside in
A. B. C. D.
Which of the following is NOT an application of the Internet? A. B. C. D.
4.
.
Which of the following does NOT involve electronic fund transfer? A.
3.
A. B. C. D.
(1) file type (2) file name (3) file size (2) only (1) and (2) only (2) and (3) only (1), (2) and (3)
(1) floppy disk drive (2) CD-ROM drive (3) hard disk (4) RAM (4), (2), (3), (1) (4), (3), (2), (1) (1), (4), (2), (3) (3), (4), (2), (1)
A data file of size 1.4 Mbytes is to be downloaded through a network with a transfer rate of 56 Kbps (kilobits per second). What is the minimum time needed? A. B. C. D.
25.6 seconds 51.2 seconds 102.4 seconds 204.8 seconds
12.
A. B. C. D. 13.
A # sign before any column letters or row numbers represents absolute addressing. Without the # sign, relative addressing is used.
A. B. C. D. 22.
2001-CE-COMP STUD 2-3 (C Version)
23.
0 25 30 45
Which of the following is/are effective for protecting a computer system from computer virus infection?
A. B. C. D.
.
syntax error run-time error logic error transcription error
Which of the following methods should be used to protect files from unauthorized access?
Consider the following spreadsheet:
If the formula stored in cell A3 is copied to cell B3, what will be the value shown in cell B3?
(1) assembler (2) compiler (3) interpreter (1) only (2) only (3) only (1), (2) and (3)
(1) program debugging (2) problem analysis (3) algorithm design (1) only (1) and (3) only (2) and (3) only (1), (2) and (3) only
(1) using search engines (2) playing computer games (3) sending electronic mail (1) only (3) only (2) and (3) only (1), (2) and (3)
A B C 1 10 15 20 2 35 20 5 3 Cell A3 contains the formula =#A1+A#2.
Pascal assembly language Structured Query Language (SQL) COBOL
Which of the following should be done before program coding?
A. B. C. D. 19.
21.
data verification data truncation data validation password
Which of the following is/are interactive processing?
A. B. C. D.
a load instruction a store instruction a jump instruction an input instruction
“Floating point overflow” is a kind of A. B. C. D.
18.
an accumulator an instruction register a memory address register a program counter
Which of the following must be used to produce an object file from a C source program?
A. B. C. D. 17.
.
Which of the following programming languages is most suitable for controlling the movement of a robot? A. B. C. D.
16.
20.
What type of instruction will have its operand transferred to the program counter? A. B. C. D.
15.
increasing the length of the mantissa by one bit increasing the length of the exponent by one bit decreasing the length of the mantissa by one bit decreasing the length of the exponent by one bit
When an instruction is fetched, it is stored in A. B. C. D.
14.
A. B. C. D.
Which of the following could double the range of a floating-point representation?
(1) scanning the system with anti-virus software (2) not opening files from unknown sources (3) backing up files periodically (1) only (1) and (2) only (1) and (3) only (1), (2) and (3)
A printer driver is a A. B. C. D.
software hardware disk drive hard disk
.
24.
A. B. C. D. 25.
a computer virus an operating system a program counter a compiler
32.
(1) adding comment statements (2) using meaningful variable names (3) using indentation (1) only (1) and (2) only (1) and (3) only (1), (2) and (3) only
(1) video (2) text (3) sound (4) graphics (1) and (3) only (1), (2) and (3) only (1), (3) and (4) only (1), (2), (3) and (4)
The structure of a database file is as follows:
2001-CE-COMP STUD 2-4 (C Version)
(1) a file attachment (2) an address book (3) an instant messaging application software (1) only (2) only (1) and (2) only (1), (2) and (3)
Which of the following is responsible for carrying out feasibility studies? A. B. C. D.
35.
a payroll system a bank account balance enquiry system a multiple-choice question marking system an electricity meter-reading reporting system
Which of the following can be found in an electronic mail?
A. B. C. D. 34.
validation verification encryption documentation
Which of the following is an example of a multi-user real time processing system? A. B. C. D.
33.
100 bytes 500 bytes 5 Kbytes 50 Kbytes
When changing a password, what is the purpose of entering the new password twice? A. B. C. D.
a syntax error a run-time error a logic erro an input error
Which of the following are considered multi-media elements?
A. B. C. D. 30.
(1) the status register (2) the program counter (3) the accumulator (1) only (2) only (2) and (3) only (1), (2) and (3)
Which of the following will make a computer program easy to read and understand?
A. B. C. D. 29.
31.
Which of the following error can be detected by a C compiler? A. B. C. D.
28.
A. B. C. D.
Which of the following is NOT a computer program? A. B. C. D.
27.
(1) a scanner (2) an optical character recognition system (3) a magnetic ink character recognition device (1) only (3) only (1) and (2) only (1), (2) and (3)
Before a conditional branch instruction is executed, which of the following will be examined?
A. B. C. D. 26.
Field Size (byte) Name 35 Sex 1 ID Card No 12 Blood Type 2 Address 50 What is the approximate file size if there are 50 records in the file?
A teacher reads a good passage. She would like to make a few amendments to the passage and distribute the printout to her students. If she does not want to re-type the whole passage again, which of the following device/system would she use?
a programmer a computer operator a system analyst a network administrator
Which of the following is a software? A. B. C. D.
a web browser a CD-ROM drive a visual display unit a modem
system? 36.
Which of the following is NOT a register? A. B. C. D.
37.
an instruction register a status register an accumulator an arithmetic and logic unit
A(n) x is used to translate a(n) y program to a(n) z program. x interpreter interpreter compiler compiler
A. B. C. D. 38.
object source object source
z source object source object
Which of the following is a disadvantage of using lowlevel language? A. B. C. D.
39.
y
The language is impossible to learn. The execution time is very slow. The language is machine dependent. The source code is very long.
Which of the following are the functions of an operating
For questions 41-50, find the output of the given program. 41.
#include <stdio.h> int main() { int x;
}
x = rand() % 10 + 1; while ( x < 1 && x > 10 ) { printf("%d", x); x++; } printf("END\n");
A. B. C. D.
END 678910END 12345678910END The output cannot be determined.
2001-CE-COMP STUD 2-5 (C Version)
A. B. C. D. 40.
(1) memory management (2) input/output control (3) user interface (1) and (2) only (1) and (3) only (2) and (3) only (1), (2) and (3)
Problem solving procedures include the following: (1) algorithm design (2) program coding (3) program debugging (4) problem definition (5) problem analysis (6) program documentation Which of the following is the correct order of the problem solving procedures? A. B. C. D.
452136 451236 645123 564213
42.
#include <stdio.h> int main() { int i; char s[80], t[80]; strcpy(s, "ABCDEFGHIJ"); for ( i = 0; i < 10; i++ ) { strcpy(t, s + i); t[i + 1] = '\0'; strcat(s, t); } printf("%d\n", strlen(s)); } A. B. C. D.
43.
10 20 55 65
#include <stdio.h> int main() { int x[4]; char y[4]; int i;
}
x[0] = 1; y[0] = 'A'; for ( i = 1; i { x[i] = x[i y[i] = y[i } printf("%c\n",
A. B. C. D. 44.
<= 3; i++ ) 1] + i + 1; 1] + x[i]; y[3]);
J N Q T
#include <stdio.h> int main() { int i; for ( i = 1; i <= 10; i++ ) if ( i > 3 || i < 6 ) printf("%d", i); printf("END\n"); } A. B. C. D.
END 45END 3456END 12345678910END
2001-CE-COMP STUD 2-6 (C Version)
45.
#include <stdio.h> int main() { int x; x = 0; while ( x <= 100 ) { x += 10; switch ( ((int) sqrt((double) x)) % 2 ) { case 0: printf("P"); break; case 1: printf("Q"); break; } } printf("\n"); } A. B. C. D.
46.
PQPQPQPQPQP QPQPQPQPQPQ PQPQPPQQPQQ QPQPQQPPQPP
#include <stdio.h> int main() { int err; char text[80]; int i; strcpy(text, "2001HKCEE"); err = -1; for ( i = 0; i < 10; i++ ) if ( text[i] < '0' || text[i] > '9' ) { err = i; i = 9; } printf("%d\n", err); } A. B. C. D.
-1 3 4 5
2001-CE-COMP STUD 2-7 (C Version)
47.
#include <stdio.h> int main() { int a[12]; int k;
}
a[0] = 1; a[1] = 1; for ( k = 2; k <= 7; k++ ) a[k] = a[k - 1] + a[k - 2]; printf("%d\n", a[7]);
A. B. C. D. 48.
8 13 21 34
#include <stdio.h> int main() { char source[80], secret[80]; char e, d; int i, tmp; strcpy(source, "COMPUTER"); strcpy(secret, ""); for ( i = 0; i < strlen(source); i++ ) { e = source[i]; tmp = ((int) e) + 13; if ( tmp > 90 ) tmp -= 26; d = (char) tmp; secret[i] = d; secret[i + 1] = '\0'; } printf("%s\n", secret); } A. B. C. D.
49.
UXPRPBZC IRELTBBQ PBZCHGRE VYBIRLBH
#include <stdio.h> int main() { if ( !((0 > -5) && (-7 < -5)) ) printf("1"); else if ( 'z' > 'Z' ) printf("2"); if ( strcmp("computer", "company") > 0 ) printf("3"); } A. B. C. D.
2 13 23 123
2001-CE-COMP STUD 2-8 (C Version)
50.
#include <stdio.h> void ONE(int x, int* y) { int m; m = 3; *y = m + x; x = m + *y; } int main() { int a, b; a = 4; b = 5; ONE(a, &b); printf("%-5d%-5d\n", a, b); } A. B. C. D.
4 4 10 10
5 7 5 7
2001-CE-COMP STUD 2-9 (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
2001-CE-COMP STUD 2-10 (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
2001-CE-COMP STUD 2-11 (C Version)
Question No.
Key
Question No.
Key
1. 2. 3. 4. 5.
D A B A C
26. 27. 28. 29. 30.
C A D D C
6. 7. 8. 9. 10.
A deleted B C B
31. 32. 33. 34. 35.
B B A C A
11. 12. 13. 14. 15.
D B B C B
36. 37. 38. 39. 40.
D D C D B
16. 17. 18. 19. 20.
B B C D D
41. 42. 43. 44. 45.
A D D D D
21. 22. 23. 24. 25.
C B A C A
46. 47. 48. 49. 50.
C C C C B
Note: Figures in brackets indicate the percentage of candidates choosing the correct answers.
2001-CE-COMP STUD 2-12 (C Version)