Practice

Filter Pass Marks to a File

HARDFile Handling10 marks
File I/O questionmarks.txt is pre-loaded for you during grading.

The file marks.txt contains integer marks, one per line. Copy every mark that is 50 or more into a new file pass.txt. Then output Passes: <count> followed by each passing mark (read back from pass.txt).

Input: None (data is already in the file). Output: The pass count, then each passing mark.

Example:

Output: Passes: 3
        50
        72
        90
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Three passes including the boundary 50
marks.txt
45
50
72
33
90
Expected: Passes: 3 50 72 90
Test 2: No mark reaches 50
marks.txt
0
20
49
Expected: Passes: 0