Quelpr

Other parts of this question

  1. 6(a)(i)Briefly describe the declarative programming paradigm.[2 marks]
  2. 6(a)(iii)Briefly describe scripting languages.[2 marks]
  3. 6(b)Determine the exact output produced by the given C program.[9 marks]
  4. 6(c)(i)Write 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).[2 marks]
  5. 6(c)(ii)Declare two variables, apple and pear, of type struct fruitRec.[1 mark]
  6. 6(c)(iii)Write C code to populate the apple struct variable with sample data.[2 marks]
  7. 6(c)(iv)Assuming two fruitRec variables pine and mango are populated, write C code to swap their cost price and selling price values.[2 marks]
  8. 6(c)(v)Assuming two fruitRec variables a and b are populated, write C code to compute and display the total expected profit from selling both fruits.[3 marks]

More practice: the rest of this paper · more Programming Paradigms and Translation questions · all CAPE Computer Science Unit 1 past papers