Quelpr

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. 1(a)16 marksDraw a level-0 data flow diagram representing the given costume rental scenario.
  2. 1(b)(i)2 marksState TWO advantages of the evolutionary approach to software development.
  3. 1(b)(ii)6 marksDiscuss TWO weaknesses of the evolutionary approach.
  4. 1(c)(i)4 marksDiscuss the reuse-oriented approach for software development.
  5. 1(c)(ii)2 marksState TWO advantages of the reuse-oriented approach.
  6. 2(a)(i)6 marksDescribe THREE main components of an entity-relationship model.
  7. 2(a)(ii)2 marksState TWO sources from which a systems analyst can gather information to create an entity-relationship model.
  8. 2(a)(iii)16 marksDraw an entity-relationship model based on the bank narrative provided.
  9. 2(b)(i)3 marksExplain what is meant by a data dictionary.
  10. 2(b)(ii)3 marksDescribe the contents of an entry made in a data dictionary.
  11. 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.
  12. 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.
  13. 3(b)8 marksIdentify and describe FOUR steps (or stages) of the object-oriented process.
  14. 3(c)6 marksExplain why it is advisable to always write programs that are portable and maintainable.
  15. 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,…
  16. 4(b)7 marksGiven that L1 contains 100 integer elements, write an algorithm to reverse the elements of L1.
  17. 4(c)(i)3 marksDescribe 2nd generation programming languages.
  18. 4(c)(ii)3 marksDescribe 3rd generation programming languages.
  19. 4(d)4 marksWhat is meant by structured programming?
  20. 4(e)4 marksExplain how a program written in a high-level language is executed on a computer.
  21. 5(a)6 marksIdentify the GUI objects to use in this application and state the purpose of each.
  22. 5(b)4 marksDraw the GUI layout and label the GUI components identified in 5(a).
  23. 5(c)4 marksExplain TWO events that the program should anticipate.
  24. 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.
  25. 5(e)6 marksWrite code to retrieve user inputs, calculate the Simple Interest, and display the result in the corresponding GUI component.
  26. 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.
  27. 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.
  28. 6(b)(i)2 marksWrite a code fragment to instantiate TWO Product objects using arbitrary data and assign them to separate variables.
  29. 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.
  30. 6(b)(iii)5 marksWrite code to print the names of all Product objects in the data structure that need to be reordered.
  31. 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.

More CAPE Computer Science Unit 2 papers