CAPE Computer Science Unit 1 · 2009 · Paper 2
34 questions and parts from this paper. Open one to see it in full, then practise it on Quelpr and get it marked against the mark scheme.
- 1(a)6 marksDraw the logic symbol and provide the corresponding truth table for THREE primary logic gates.
- 1(b)6 marksUsing the primary logic gates from part (a), design and draw a circuit that implements the truth table of the exclusive-OR gate shown in Table 1.
- 1(c)6 marksDraw a clearly labelled block diagram of a 4 x 1 multiplexer having 4 inputs and 1 output.
- 1(d)(i)1 markCalculate the decimal equivalent of
00011011_2. - 1(d)(ii)2 marksDetermine whether the result of
0111 + 1110can be stored as a 4-bit binary number. - 1(d)(iii)2 marksShowing all working, find the largest and smallest integers that can be represented using 4-bit signed magnitude (with the leftmost bit as the sign bit).
- 1(d)(iv)2 marksFind the 4-bit two's complement representation of -5.
- 2(a)(i)2 marksExplain what is meant by the term: Word size.
- 2(a)(ii)2 marksExplain what is meant by the term: Cache memory.
- 2(a)(iii)2 marksExplain what is meant by the term: Clock speed.
- 2(b)(i)2 marksDistinguish between ROM and RAM as they pertain to computer memory.
- 2(b)(ii)2 marksDistinguish between access speed and access method as they pertain to computer memory.
- 2(b)(iii)2 marksDistinguish between volatility and capacity as they pertain to computer memory.
- 2(c)(i)2 marksDefine the terms 'instruction set' and 'instruction format'.
- 2(c)(ii)3 marksState THREE types of instructions typically included in an instruction set.
- 2(c)(iii)3 marksSuppose 16 bits are used to represent instructions in a computer. Using a diagram, explain how a 2-address instruction can be formatted using the 16 available bits.
- 2(c)(iv)5 marksDescribe what happens during a typical instruction cycle, assuming direct addressing is used.
- 3(a)2 marksWhat is an algorithm?
- 3(b)3 marksName THREE basic control constructs used in structured programming.
- 3(c)(i)2 marksBased on the algorithm shown, what are the final values stored in variables c and j when execution terminates?
- 3(c)(ii)6 marksReferring to specific line numbers, identify and correct the errors in the algorithm so that it generates, prints, and counts the odd numbers between 1 and 99 inclusive.
- 3(c)(iii)1 markUsing the corrected algorithm, state the final value of variable c at the end of execution.
- 3(d)11 marksConstruct a flowchart to represent the algorithm shown.
- 4(a)6 marksDiscuss what the 'Identifying and evaluating possible solutions' stage of problem solving would involve for BuyLo.
- 4(b)11 marksTrace through the execution of the given algorithm and draw the exact output produced, using '-' to represent spaces printed by printSpaces(n).
- 4(c)8 marksWrite an algorithm that uses repetition to find the sum of all multiples of 7 between 14 (inclusive) and 126 (inclusive).
- 5(a)6 marksDescribe the 'lexical analysis' and 'semantic analysis' stages of the translation process.
- 5(b)4 marksWrite a C function that takes two distinct integer parameters, a and b, and returns the larger integer.
- 5(c)15 marksWrite a complete C program that prompts the user for 10 integers and writes them into a text file 'in.dat' (one per line), closes the file, reopens it, computes and prints the average of the integers, and outputs an…
- 6(a)(i)2 marksBriefly describe the declarative classification of programming languages.
- 6(a)(ii)2 marksBriefly describe the imperative (procedural) classification of programming languages.
- 6(a)(iii)2 marksBriefly describe the scripting classification of programming languages.
- 6(b)3 marksDistinguish between 'syntax' and 'semantics' in computer programming.
- 6(c)16 marksComplete the main C program using the provided declarations to repeatedly read input data (id, hrs, rate) until sentinel ID 999 is entered, calculating daily salary and updating totalPay and numDays for each…