Quelpr

CAPE Computer Science Unit 1 · 2015 · Paper 2 · Question 5(c)

Processing a text file 'testgrades.txt' containing student IDs and final marks.

Write 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.

This question uses a figure or table from the paper — you'll see it when you practise.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 5(a)(i)Describe the purpose of the lexical analysis stage in translation.[3 marks]
  2. 5(a)(ii)Comment on whether error detection exists during the lexical analysis stage.[1 mark]
  3. 5(b)Explain what modular programming is and how it promotes good programming practices.[2 marks]
  4. 5(d)Write a C program that takes a lowercase string from the user and checks whether it is a palindrome.[9 marks]

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