Question: Python 3.5 This is my Student Class: https://pastebin.com/rgFJFvv8 It is saved as Student.py in the same directory as all the files. This is my other

Python 3.5

This is my Student Class: https://pastebin.com/rgFJFvv8 It is saved as Student.py in the same directory as all the files.

This is my other python file: https://pastebin.com/KPuq1j1L

It is saved as A1.py in the same directory as Student.py

Need help completing read_classlist()

You are required to complete the read_classlist() function which returns a list of Student objects. If the second option of the menu, i.e., Read a ClassList, is selected, the program should allow the user to type in a file name for reading a class list. If the file exists you can print out a confirmation message. If the file doesn't exist you should tell the user that the file cannot be found and display the main menu again. Note that the function should also print the list of students for our marking purpose

You may use the String data type's split() method to split apart the data from the file. You will need to think about the order in which you need to split your items. For example, your file is organized so that one student's record occupies an entire line in the file. Splitting first on the line break will isolate each student's data. (You may want to use the splitlines() method from the String class. This method returns a list of the lines in the string, breaking at line boundaries and line breaks are not included in the resulting list.) Then you will need to further split each item based on the separator character to pull out the name, id and email address.

Here's a sample running of this section with an invalid filename:

Enter your choice: 2 --------------------------------------------------- Enter name of the classlist file: out.txt File out.txt could not be opened --------------------------------------------------- ... 6. Quit the program --------------------------------------------------- Enter your choice

Here's a sample running of this section with a valid filename:

Enter your choice: 2 --------------------------------------------------- Enter name of the classlist file: classlist.txt Completed reading of file classlist.txt N00000001: John, john@amail.com, marks: [] N00000002: Kelly, kelly@bmail.com, marks: [] N00000003: Nicky, nicky@cmail.com, marks: [] N00000004: Sam, sam@dmail.com, marks: [] N00000005: Adam, adam@amail.com, marks: [] --------------------------------------------------- ... 6. Quit the program --------------------------------------------------- Enter your choice: :

classlist.txt contains a class list of the course in the following format:

John,N00000001,john@amail.com Kelly,N00000002,kelly@bmail.com Nicky,N00000003,nicky@cmail.com Sam,N00000004,sam@dmail.com Adam,N00000005,adam@amail.com

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!