CAPE Computer Science Unit 2 · 2012 · Paper 2
28 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)(i)3 marksExplain the difference between the Stack ADT and the C implementation of the stack.
- 1(a)(ii)4 marksDeclare the variables needed for implementing the stack in C and describe the purpose of each, assuming it stores at most 100 integer elements.
- 1(a)(iii)8 marksWrite C code for push(element) and pop() operations, accounting for overflow and underflow conditions.
- 1(b)4 marksGiven an initially empty linked list with an insert operation at the beginning, draw the linked list after inserting 43, 38, 25 in order, clearly indicating the beginning and ending of the list.
- 1(c)6 marksGiven a queue q with an unknown number of elements and a stack stk, write an algorithm using only Stack and Queue ADT operations to reverse the order of elements in q.
- 2(a)10 marksWrite C code that takes two integers, lower and upper (where lower < upper), and counts and prints the number of marks in an unsorted array of 100 student marks between lower and upper inclusive, printing an error…
- 2(b)(i)6 marksDescribe how a binary search algorithm will search arr for key 16, showing the portion of the array searched each iteration.
- 2(b)(ii)6 marksDescribe how a binary search algorithm will search arr for key 63, showing the portion of the array searched each iteration.
- 2(c)3 marksDraw the array after the first, second, and third passes of the selection sort algorithm (three diagrams in all).
- 3(a)14 marksDraw a level-0 data flow diagram depicting the university registration scenario.
- 3(b)4 marksDescribe one advantage and one disadvantage of the evolutionary approach to software development.
- 3(c)5 marksDescribe four phases in the waterfall approach to software development and state the order in which they occur.
- 3(d)2 marksDiscuss one reason why it is important to involve end users in software product development.
- 4(a)(i)6 marksDescribe the main components of an entity-relationship model.
- 4(a)(ii)13 marksDraw an entity-relationship model for the described software project and employee scenario.
- 4(b)6 marksDescribe three tests that can be used to determine if binarySearch is working correctly.
- 5(a)(i)2 marksDescribe the characteristics of twisted pair transmission media.
- 5(a)(ii)2 marksDescribe the characteristics of fibre optic cable transmission media.
- 5(b)4 marksA ring network contains four computers, one of which has failed. Explain one modification to allow the remaining three computers to communicate, using a diagram.
- 5(c)3 marksWith the aid of a diagram, explain the role of a hub in a local area network.
- 5(d)6 marksWith the aid of a diagram, explain how data is communicated in an IEEE802.11a network.
- 5(e)3 marksOutline the role of a firewall on a computer network.
- 5(f)5 marksState the role of each of layers 1 to 5 of the OSI model for network communication.
- 6(a)4 marksUsing a diagram, explain how a deadlock can occur in an operating system.
- 6(b)4 marksBriefly explain how a software interrupt is handled in a single-processor system.
- 6(c)9 marksList and describe three states that a process may enter during execution.
- 6(d)6 marksDescribe three components of a process control block (PCB).
- 6(e)2 marksState one advantage of a menu interface over a command interface.