CAPE Computer Science Paper 1 Flashcards

(57 cards)

1
Q

What is the largest integer that can be represented in 4-bit signed magnitude?

A

7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the 4-bit two’s complement of 8?

A

Invalid - 8 cannot be represented in 4-bit two’s complement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the 8-bit sign-and-magnitude representation of -29?

A

10011101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What type of computer system is used for weather forecasting?

A

Supercomputers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The range of instructions a CPU can execute is called the:

A

Instruction set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What stores permanent binary information?

A

ROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What component handles “if x < 0”?

A

ALU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What component coordinates saving a file?

A

Control Unit (CU)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is flash memory?

A

EEPROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which memory component is the fastest?

A

Registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Flip-flops are:

A

Two-state devices; registers are made from them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Popular scheme for representing characters?

A

ASCII

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which logic gate statements are FALSE?

A

I and II only (NOT gate doesn’t have more than one input)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Correct C code to read a double num:

A

scanf(“%lf”, &num);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Data type best for storing currency:

A

Double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Invalid variable name:

A

2ndmark

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Tool to combine compiled modules into an executable:

A

Linker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Tool translating one line at a time:

A

Interpreter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Tool translating high-level to machine code all at once:

A

Compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Purpose of fetch in fetch-decode-execute cycle:

A

Obtaining an instruction from memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the value of a after for(i=1;i<5;i++) a *= i;?

A

24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What error is present if a leap year isn’t accounted for?

A

Logic error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which control structure reads unknown number of file records?

A

Sentinel control loop

24
Q

Statement to output an integer x to file pointer fp:

A

fprintf(fp, “%d”, x);

25
In the implementation stage of problem-solving, implementation refers to:
Writing of algorithms
26
Best loop type for: `while ((c = getchar()) != '\0')`
Sentinel loop (unbounded iteration)
27
What is the output of: for y = 1 to 3 for z = 1 to y print "*"
* ** ***
28
What is the LARGEST integer that can be represented in a 4-bit signed magnitude?
(B) +7
29
What is the 4-bit two's complement of -8?
(A) 1 0 0 0
30
Which memory type is BEST for quickly retrieving a small number of instructions by a processor?
(C) Cache memory
31
What is the 8-bit sign and magnitude representation of the decimal number -29?
(D) 1 0 0 1 1 1 0 1
32
Which of the following BEST defines 'clock speed'?
(D) The speed at which the micro-processor executes instructions
33
What does the decode part of the fetch-decode-execute cycle involve?
(B) Determining what the operation is
34
Which device is used to store permanent binary information?
(A) ROM
35
Which statements about flip-flops are TRUE?
(C) II and III only (Flip-flops are two-state devices; registers are made up of flip-flops)
36
The 8-bit sign and magnitude representation 10010101 corresponds to which decimal number?
(B) -21
37
How is the mismatch in speeds between CPU and memory access reduced?
(B) Using cache memory
38
Which is NOT an advantage of storage devices over main memory?
(C) Greater response time
39
Which address instruction format is used in the given low-level program segment?
(B) One address
40
Which statements about logic gates are FALSE?
(A) I and II only (A NOT gate cannot have multiple inputs; a NOR gate can have multiple inputs)
41
Which component consists of very high-speed memory?
(D) Registers
42
Which control structure is used when the number of records in a file is unknown?
(B) A sentinel control loop
43
Which control structures are used in structured programming?
(A) I and II only (Sequence and Selection)
44
What is the output of the nested loop algorithm printing asterisks?
(D) \* \*\* \*\*\*
45
Which line in the algorithm for printing half the sum of two integers contains an error?
(C) Line 3 (Should be Sum = (A + B)/2)
46
Which criteria should be considered when choosing a programming language?
(D) I, II, and III (Nature of application, compiler availability, programmer expertise)
47
What is the MOST appropriate C declaration for storing the square root of an integer?
(A) double num;
48
What is the value of sum after the modified if condition in the given code segment?
(D) 20
49
Which is NOT a valid variable identifier?
(B) 2ndmark (Identifiers cannot start with a digit)
50
What is the value of a after the loop in the given code executes?
(C) 24
51
What output does the provided C program produce?
(C) The value of a is 10 Goodbye
52
Which type of error is caused by dividing by zero?
(C) Run time
53
What is printed by the code segment iterating over the given array?
(D) 23 27 56 92
54
What is the name of the variable x in the function definition displayData(int x)?
(A) Formal parameter
55
Which process attaches prewritten routines before program execution?
(A) Linker
56
Which statement correctly stores the value of x in a file in C?
(B) fprintf(fp, %d, x);
57
At which compilation stages are a missing parenthesis and wrong-type assignment detected?
(B) (a) syntax, (b) lexical