Professional Documents
Culture Documents
COMP STUD
PAPER IA
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.
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.
7 6 5 4 3 2 1 0 bit number
parity bit
Which of the following bit patterns represents the
character ‘U’?
(1) Plotter
(2) CD-ROM Drive
(3) Scanner
(4) Hard Disk Drive
A. (1) and (2) only
B. (2) and (4) only
C. (1) and (3) only
D. (1) and (4) only
E. (3) and (4) only
19. People can work at home using a home computer 24. Which of the following about a stack is/are true?
connected to the computer in their office. Which of the
following is false? (1) It is a first-in-first-out data structure.
(2) Two pointers are required for a stack
A. It provides a relax working atmosphere. operation.
B. There is better team spirit. (3) It can be used to store returning addresses
C. There is possible family distraction. for procedure calls in a program
D. Less office space is needed. A. (1) only
E. It allows flexible working hours. B. (2) only
C. (3) only
20. Which of the following is NOT normally sold as part of an D. (1) and (2) only
office automation software package? E. (1) and (3) only
A. User’s manual 25. The decimal number 3.375 in binary normalized form is
B. Operation guide
C. Tutorial manual A. 0.11011 1010
D. Program listing B. 0.11011 10-10
E. Trouble shooting manual C. 11011 1011
D. 11011 10-11
21. In stages of computerization, the person mainly E. 1.1011 1001
responsible for producing the system flowchart is the
. 26. Using 13-bit, 2’s complement representation, what is the
result of –513 – 512?
A. electronic data processing manager
B. system analyst A. 1000000000001
C. systems engineer B. 1101111111111
D. programmer C. 0111111111111
E. computer operator D. underflow occurs
E. overflow occurs
22. The following steps are supposed to sum the integers of 1
to 9 and store the result in Y. 27. Which of the following tasks can be performed by a
database management system?
Step 1 assign 1 to X
Step 2 if X > 9 then go to step 6 (1) listing customers who used mobile phone
Step 3 assign the value of (Y + X) to Y for more than 100 minutes in last month
Step 4 assign the value of (X + 1) to X (2) sorting students’ marks in descending
Step 5 go to step 2 order
Step 6 output the value of Y (3) producing invitation letters to customers
Execution of the above steps cannot get the correct A. (1) only
answer. Which of the followings is the possible reason for B. (3) only
the error? C. (1) and (2) only
D. (2) and (3) only
A. Variable X is not initialized. E. (1), (2) and (3)
B. Variable Y is not initialized.
C. There is an infinite loop.
D. The value of X is not output.
E. Step 3 and Step 4 are misplaced.
(1) withdrawing money from a bank account 34. Which of the following is/are the duties of a computer
through an automatic teller machine operator?
(2) sending bank statements to customers
(3) booking airline tickets (1) mounting disks
A. (1) only (2) backing up data
B. (2) only (3) collecting and entering data
C. (3) only A. (1) only
D. (1) and (2) only B. (2) only
E. (1) and (3) only C. (1) and (2) only
D. (2) and (3) only
31. A company uses a sequential file to store the records of its E. (1), (2) and (3)
employees. Which of the following statements is/are true?
35. Which of the following techniques can be used during
(1) An employee’s record can be located algorithm design?
using a sequential search.
(2) An employee’s record can be located A. decomposing the problem
using a binary search. B. documenting the program
(3) An employee’s record can be located C. defining the problem
directly. D. coding the program
E. debugging the program
int main()
{
printf("%d\n", (int) ((abs(-9.5) - 2.0) / 2));
}
A. 0
B. 1
C. 2
D. 3
E. 4
int main()
{
char a[10], b[10], x[10], y[10], z[10];
strcpy(x, "10101010");
strcpy(y, "10101");
strcpy(z, x);
strcat(z, y);
strncpy(a, z + 1, 3);
a[3] = '\0';
strncpy(b, z + 4, 2);
b[2] = '\0';
strcat(a, b);
printf("%s\n", a);
}
A. 00100
B. 01010
C. 01011
D. 01101
E. 01110
int main()
{
const int k = 8;
char s[k];
int i;
strcpy(s, "legco");
switch ( s[k - strlen(s) - 2] )
{
case 'o' : i = 2; break;
case 'c' : i = 4; break;
case 'g' : i = 6; break;
case 'e' : i = 8; break;
case 'l' : i = 10; break;
default: i = 5;
}
printf("%d\n", i % (k - 1));
}
A. 0
B. 1
C. 2
D. 3
E. 4
int main()
{
int x, y, z;
x = 1;
y = 2;
z = 3;
change(y, z, x);
printf("%d%d%d\n", x, y, z);
}
A. 231
123
B. 233
123
C. 311
123
D. 231
231
E. 311
311
int main()
{
int data[7];
int k;
A. 3
B. 6
C. 8
D. 11
E. 12
int main()
{
int i, j;
i = 2;
for ( j = 3; j >= 0; j-- )
{
i = i + j;
printf("%d", i);
}
}
A. 543
B. 578
C. 5432
D. 5433
E. 5788
int main()
{
printf("%d\n", GREAT(a, b) + GREAT(b, a));
}
A. 8
B. 11
C. 14
D. 74
E. 77
typedef struct
{
int a;
char b;
} link;
int main()
{
int i;
link x[10];
A. ZY
B. ZYXV
C. ZYXVR
D. ZYXVRQ
E. ZYXVURQ
44. (This question involves features available in Pascal but not in C. So it is not possible to re-write the program in C).
typedef struct
{
char x;
int y;
int z;
} rec;
int main()
{
rec r;
r.x = 'L';
r.y = (int) sqrt((float) r.x) + 1;
r.z = ((int) r.x) % r.y;
printf("%d\n", r.z);
}
A. 4
B. 5
C. 6
D. 7
E. 8
46. Multimedia files must be compressed before saving to Rewritable CD are suitable media for storing
the mass storage media. multimedia files.
47. In a microcomputer, the number of bytes required to Chinese character can be inputted by a combination of
store a Chinese character is more than an English keys on a keyboard.
character.
48. Compression can improve file security. A compressed file cannot be viewed using software
which originally created the uncompressed file.
49. An object program is free of syntax errors. A compiler can be used to detect all errors in a source
program.
50. A machine code program is generally difficult for A machine code program cannot include comment
people to read. statements.
#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
1. D 26. B
2. A 27. E
3. C 28. E
4. B 29. C
5. E 30. E
6. E 31. A
7. E 32. D
8. C 33. D
9. A 34. C
10. C 35. A
11. C 36. D
12. E 37. B
13. E 38. B
14. D 39. C
15. A 40. A
21. B 46. D
22. B 47. B
23. B 48. D
24. C 49. C
25. A 50. A
Note: Figures in brackets indicate the percentage of candidates choosing the correct answers.