CAPE Computer Science Unit 2 · 2006 · Paper 2
31 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)16 marksDraw a level-0 data flow diagram representing the given costume rental scenario.
- 1(b)(i)2 marksState TWO advantages of the evolutionary approach to software development.
- 1(b)(ii)6 marksDiscuss TWO weaknesses of the evolutionary approach.
- 1(c)(i)4 marksDiscuss the reuse-oriented approach for software development.
- 1(c)(ii)2 marksState TWO advantages of the reuse-oriented approach.
- 2(a)(i)6 marksDescribe THREE main components of an entity-relationship model.
- 2(a)(ii)2 marksState TWO sources from which a systems analyst can gather information to create an entity-relationship model.
- 2(a)(iii)16 marksDraw an entity-relationship model based on the bank narrative provided.
- 2(b)(i)3 marksExplain what is meant by a data dictionary.
- 2(b)(ii)3 marksDescribe the contents of an entry made in a data dictionary.
- 3(a)(i)11 marksWrite a recursive function in pseudocode to search arr for a value named key. Return the index where it was found, or return -1 if key is not present.
- 3(a)(ii)5 marksWrite a segment of code that prompts the user for key, calls the search function in 3(a)(i), and displays an error message if not found or the location if found.
- 3(b)8 marksIdentify and describe FOUR steps (or stages) of the object-oriented process.
- 3(c)6 marksExplain why it is advisable to always write programs that are portable and maintainable.
- 4(a)9 marksA list L1 contains 100 elements, and a list L2 of size 150 has 20 elements stored in its first 20 locations (indices 0 to 19). Write an algorithm to move all elements of L1 to L2 starting at the first location of L2,…
- 4(b)7 marksGiven that L1 contains 100 integer elements, write an algorithm to reverse the elements of L1.
- 4(c)(i)3 marksDescribe 2nd generation programming languages.
- 4(c)(ii)3 marksDescribe 3rd generation programming languages.
- 4(d)4 marksWhat is meant by structured programming?
- 4(e)4 marksExplain how a program written in a high-level language is executed on a computer.
- 5(a)6 marksIdentify the GUI objects to use in this application and state the purpose of each.
- 5(b)4 marksDraw the GUI layout and label the GUI components identified in 5(a).
- 5(c)4 marksExplain TWO events that the program should anticipate.
- 5(d)6 marksWrite the code to instantiate GUI object L, populate it with the numbers 1 to 30, and add it to the GUI.
- 5(e)6 marksWrite code to retrieve user inputs, calculate the Simple Interest, and display the result in the corresponding GUI component.
- 5(f)4 marksUsing the calculated Simple Interest from 5(e), write code to compute the monthly instalment and display it in the appropriate GUI component.
- 6(a)16 marksWrite the code for the Product class including the instance variables, constructor, accessor methods, toString() method, and the methods reduceItems(int amt) and reorder() as specified.
- 6(b)(i)2 marksWrite a code fragment to instantiate TWO Product objects using arbitrary data and assign them to separate variables.
- 6(b)(ii)3 marksWrite a code fragment to create/instantiate a named data structure to store all Product objects and add the two Product objects from 6(b)(i) to it.
- 6(b)(iii)5 marksWrite code to print the names of all Product objects in the data structure that need to be reordered.
- 6(c)4 marksDiscuss the easiest way to reuse the functionality of the Product class in another application that requires additional instance variables and an alternate reorder() implementation.