Reference no: EM132397213
CS101 Introduction to Computing Assignment
Tasks -
1. Open the file a05b.py and follow the instructions given below:
(a) Write a function with the exact name of writeMissingEntries that takes an argument from a file named 'studentRecord.txt' line by line. Each line represents some important information and scores of a student. The first element is the roll number of the student and the second is the full name. The rest of the elements are the student's scores in quizzes. There are total three quizzes. Some students may have more quizzes than the others. For instance, in the example below, the first student has 3 quizzes while the third has only 2 (of which, the third got a 'A' which shows the student was absent). A in the score is the same as a 0. The problem is that some entries might be missing e.g. there are only two entries against Jamal Khan. So writeMissingEntries should find such missing and should write in 'logfile.log'. Some contents of 'studentRecord.txt' are:
Some contents of 'studentRecord.txt' are:
18P-0001, Ali Ahmed, 7, 4, 6
18P-0130, Hassan Jan, A, 8, 0
18P-0402, Jamal Khan, 10, 6
18P-0145, Hamza Saeed, 6,4.5, 6
Your task is to call writeMissingEntries that write those lines which has missing entries in another file named 'logfile.log'. You can solve this problem using different approaches, but basic requirement is that writeMissingEntries function should handle 'IndexError' exception in appropriate manner.
So, it should store the following information in 'logfile.log' file: [18P-0402, Jamal Khan, 10, 6]
Your function should be able to handle any number of student records passed to it.
Make sure you preserve the order of records in the file. If the order of students is changed, your tests may not pass.
2. Then, run local tests using the python run.py local.
3. If all tests succeed, submit your assignment using python run.py remote.
4. Run local tests and if they pass, submit the assignment using the submission command given on the Autograder assignment page. (Same as the previous assignment.)
5. Once the submission is successful, you may visit the Autograder front-end to view your submission history.
6. If you face any issue, please send me an email informing me of the error. We're still trying to work out the issues in this new system. So, your help will be greatly appreciated.
Attachment:- Introduction to Computing Assignment Files.rar