logo

Crowdly

3.2 Write a complete program that reads a list of student names and marks fr...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

3.2 Write a complete program that reads a list of student names and marks from a text file called students.txt. Each line of the file contains a name and a mark separated by a comma. The program should:

  • Open the file for reading.
  • Read each line and split it into name and mark.
  • Convert the mark to an integer.
  • Determine whether the student has passed (mark ≥ 50).
  • Print the result for each student.
  • Handle file not found and data conversion errors using exception handling. [25 Marks]
More questions like this

Want instant access to all verified answers on learning.richfield.ac.za?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!