2004 ce cs paper ii c version

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

Upload: api-3739994

Post on 11-Apr-2015

173 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 2004 CE CS Paper II C Version

2004-CECOMP STUD

PAPER II

HONG KONG EXAMINATION AND ASSESSMENT AUTHORITYHONG 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)

Page 2: 2004 CE CS Paper II 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 phoneB. a graphics tabletC. a dictionary in a compact disc with videos and sound recordedD. 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 expertB. to decrease the workload of expertsC. to replace expertsD. 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 cableB. the optical fibreC. the telephone lineD. 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 demandB. a search engineC. teleconferencingD. 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) onlyB. (3) onlyC. (1) and (2) onlyD. (2) and (3) only

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

Page 3: 2004 CE CS Paper II C Version

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

File name Type Size (bytes)NAME character 5AMOUNT integer 2

Then he amends the contents of the record as follows:

NAME AMOUNTJACK 10000

is amended to NAME AMOUNTJACKY 80

What will be the change of the file size?

A. an increase of 1 byteB. no changeC. a decrease of 1 byteD. 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-userB. batch processingC. multitaskingD. 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) onlyB. (1) and (2) onlyC. (1) and (3) onlyD. (2) and (3) only

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

A B C D E1 Item 1 Item 2 Item 3 Total amount2 March 1,000 1,500 8003 April 1,200 1,100 1,0004 May 1,300 1,200 7505

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)

Page 4: 2004 CE CS Paper II C Version

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

CODE ITEM1 A mouse2 B keypad3 CD printer4 5 tablet5 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 othersB. it is more than 1 byte wideC. the contents of CODE in the second and fifth records are the sameD. 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) onlyB. (1) and (3) onlyC. (2) and (3) onlyD. (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) onlyB. (2) onlyC. (1) and (3) onlyD. (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)

Page 5: 2004 CE CS Paper II 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 frequentlyB. the data transfer rate needs to be higher than 6M bits per secondC. the computers are located worldwideD. 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. PB. QC. RD. 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) onlyB. (2) and (3) onlyC. (3) and (4) onlyD. (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 failureB. computer virusesC. anonymous emailsD. 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 computerB. Avoiding sending personal data without encryptionC. Avoiding using your real name on the Internet under any circumstancesD. 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 tryB. Accessing a computer system without authorization but not viewing or deleting any filesC. Distributing a large amount of different freeware to friendsD. 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 programmerB. A network administratorC. A computer technicianD. 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)

Page 6: 2004 CE CS Paper II 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) onlyB. (1) and (3) onlyC. (2) and (4) onlyD. (3) and (4) only

24. When the ROM is damaged, the computer                                                                                                                          

A. cannot boot upB. needs to have its battery replacedC. can still work if the hard disk is formattedD. 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 documentsB. copying files to a compact disc rewritable (CDRW).C. sorting records in a databaseD. 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) onlyB. (1) and (4) onlyC. (2) and (4) onlyD. (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 workstationA. 5 7B. 16 64C. 31 127D. 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)

Page 7: 2004 CE CS Paper II 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) onlyB. (1) and (3) onlyC. (2) and (4) onlyD. (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 checkB. Presence checkC. Length checkD. Check sum

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

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

A. 17B. 19C. 32D. 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) onlyB. (2) and (3) onlyC. (2) and (4) onlyD. (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) onlyB. (2) and (3) onlyC. (1) and (3) onlyD. (1), (2) and (3)

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

Page 8: 2004 CE CS Paper II 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) onlyB. (2) onlyC. (3) onlyD. (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. ACCB. MDRC. MARD. 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) onlyB. (2) onlyC. (3) onlyD. (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) onlyB. (3) onlyC. (1) and (2) onlyD. (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 compilerB. a high level language and an interpreterC. a low level language and an assemblerD. a low level language and an interpreter

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

Page 9: 2004 CE CS Paper II 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 resultEnd 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) onlyB. (1) and (3) onlyC. (3) and (4) onlyD. (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. 10B. 14C. 18D. 19

42. int main(){ int a, b;

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

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

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

Page 10: 2004 CE CS Paper II 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. 30B. 31C. 32D. 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. ABCDEB. ABCDEFGHIJC. AABABCABCDABCDED. 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 5B. 5 10C. 10 5D. 10 10

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

Page 11: 2004 CE CS Paper II 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. 2B. 3C. 4D. 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. 0B. 30C. 42D. 56

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

Page 12: 2004 CE CS Paper II 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. 0B. 1C. 2D. 4

50. (Not available in C version)

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

Page 13: 2004 CE CS Paper II C Version

A Partial Character List for ASCII

Character ASCII Character ASCII Character ASCII0 48 J 74 d 1001 49 K 75 e 1012 50 L 76 f 1023 51 M 77 g 1034 52 N 78 h 1045 53 O 79 I 1056 54 P 80 j 1067 55 Q 81 k 1078 56 R 82 l 1089 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 116A 65 [ 91 u 117B 66 \ 92 v 118C 67 ] 93 w 119D 68 ^ 94 x 120E 69 _ 95 y 121F 70 ` 96 z 122G 71 a 97 { 123H 72 b 98 | 124I 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)

Page 14: 2004 CE CS Paper II C Version

Appendix

Lists of Commands in Mnemonics

Op-code Operand MeaningINP XXX input data to address XXXOUT XXX output the contents of address XXXSTA XXX store the contents of accumulator to address XXXLDA XXX load accumulator with the contents of address XXXJMP XXX jump to address XXXJPN XXX branch to address XXX if the contents of accumulator are negativeJPZ XXX branch to address XXX if the contents of accumulator are zeroINC XXX increase the contents of address XXX by 1DEC XXX decrease the contents of address XXX by 1ADD XXX add to accumulator the contents of address XXX and store the result in

accumulatorSUB XXX subtract from accumulator the contents of address XXX and store the result

in accumulatorSTP - stop

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

Page 15: 2004 CE CS Paper II 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)