Quelpr

CAPE Computer Science Unit 1 · 2015 · Paper 2

38 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)(i)8 marksWrite down the truth table showing all possible input bit combinations and outputs for the alarm scenario.
  2. 1(a)(ii)4 marksUsing only primary logic gates, design and draw the circuit for the alarm system.
  3. 1(b)2 marksExplain the meaning of the term 'demultiplexer'.
  4. 1(c)3 marksDraw a clearly labelled block diagram of a 3-to-8 line decoder.
  5. 1(d)3 marksDetermine the decimal equivalent of the hexadecimal number 1A53, showing all working.
  6. 1(e)2 marksFind the 8-bit two's complement of -21, showing all working.
  7. 1(f)3 marksGiven a floating-point format of 1-bit sign, 3-bit exponent, and 5-bit mantissa, calculate the decimal representation of 001101011, showing all working.
  8. 2(a)6 marksDescribe TWO primary functions of the CPU, including a definition of the CPU in your description.
  9. 2(b)(i)1 markState the purpose of the 'fetch' operation.
  10. 2(b)(ii)2 marksState the purpose of the 'decode' and 'execute' operations.
  11. 2(b)(iii)1 markDefine the term 'instruction set'.
  12. 2(c)(i)4 marksExplain how ROM differs from RAM.
  13. 2(c)(ii)4 marksExplain ONE advantage and ONE disadvantage for each of the two purchasing options: Option 1 (large cache, small RAM) and Option 2 (large RAM, small cache).
  14. 2(d)(i)1 markState the collective purpose of CPU registers.
  15. 2(d)(ii)6 marksName THREE CPU registers and describe the function of each.
  16. 3(a)4 marksExplain what takes place during the 'implementation and review' stage of problem-solving.
  17. 3(b)(i)1 markIdentify which of the two algorithms illustrates unbounded iteration.
  18. 3(b)(ii)1 markIdentify which of the two algorithms illustrates bounded iteration.
  19. 3(b)(iii)2 marksExplain how the loop in Algorithm 1 is expected to terminate.
  20. 3(b)(iv)2 marksExplain how the loop in Algorithm 2 is expected to terminate.
  21. 3(c)8 marksIdentify and correct FOUR errors in the algorithm by referencing their specific line numbers.
  22. 3(d)7 marksWrite an algorithm using iteration to calculate the sum of all multiples of 8 and all multiples of 11 between m (inclusive) and n (exclusive), where m and n are positive integers input by the user and n > m.
  23. 4(a)12 marksTrace the execution of the provided pseudocode algorithm and display the exact output generated.
  24. 4(b)13 marksConstruct a flowchart representing the given looping and branching algorithm.
  25. 5(a)(i)3 marksDescribe the purpose of the lexical analysis stage in translation.
  26. 5(a)(ii)1 markComment on whether error detection exists during the lexical analysis stage.
  27. 5(b)2 marksExplain what modular programming is and how it promotes good programming practices.
  28. 5(c)10 marksWrite a C program that reads 'testgrades.txt' to count and display the number of students receiving grades A (80-100), B (70-79), C (60-69), and F (<=59), along with the highest overall mark.
  29. 5(d)9 marksWrite a C program that takes a lowercase string from the user and checks whether it is a palindrome.
  30. 6(a)(i)2 marksBriefly describe the declarative programming paradigm.
  31. 6(a)(ii)2 marksBriefly describe the imperative (procedural) programming paradigm.
  32. 6(a)(iii)2 marksBriefly describe scripting languages.
  33. 6(b)9 marksDetermine the exact output produced by the given C program.
  34. 6(c)(i)2 marksWrite a declaration for a C struct fruitRec to store a fruit's ID (int), cost price (float), selling price (float), and quantity in stock (int).
  35. 6(c)(ii)1 markDeclare two variables, apple and pear, of type struct fruitRec.
  36. 6(c)(iii)2 marksWrite C code to populate the apple struct variable with sample data.
  37. 6(c)(iv)2 marksAssuming two fruitRec variables pine and mango are populated, write C code to swap their cost price and selling price values.
  38. 6(c)(v)3 marksAssuming two fruitRec variables a and b are populated, write C code to compute and display the total expected profit from selling both fruits.

More CAPE Computer Science Unit 1 papers