Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python assignment Three and four This Assignment is designed to take you through creating classes, aggregation, and manipulating arrays of objects. Scenario: A University likes

Python assignment Three and four This Assignment is designed to take you through creating classes, aggregation, and manipulating arrays of objects. Scenario: A University likes to have a simple system to keep track of all the students (graduate and undergrads). You have to create a menu-driven program for the user to use the system through the console. The following classes are needed for this object-oriented database. Title: Menu-Driven Programming with Pickling and Object-Oriented Programming in Python Instructions: Part 1: Menu-Driven Programming 1. Write a Python program that displays a menu with the following options: a. Add a student record b. View all student records c. Search for a student record d. Update a student record e. Delete a student record f. Quit 2. Implement the necessary functions for each option in the menu. For example, if the user selects "Add a student record," the program should prompt the user to enter data and save it to a file. 3. Use the appropriate exception handling to ensure that the program doesn't crash if the user enters invalid input or if there's an error in the file operations. Part 2: Pickling 1. Modify the program from Part 1 to use pickling to store and retrieve data. Use the pickle module to serialize and deserialize data. 2. When the program starts, it should check if a data file exists. If it does, load the data from the file. If not, create a new file. 3. Whenever the user adds, updates, or deletes a record, the program should save the data to the file using pickling. Part 3: Object-Oriented Programming and Inheritance 1. Refactor the code from Part 2 to use object-oriented programming. 2. Create an Address class that represents a student's address. The class should have properties that correspond to the address fields, such as street, city, state, and zip code. 3. Create a Student class that aggregates an Address class and represents a student record. The class should have properties that correspond to the data fields in the student record, such as name, student ID, and GPA. 4. Implement methods to add, view, search, update, and delete student records. 5. Create a subclass called Undergrad that inherits from the Student class. The subclass should have additional properties and methods specific to an undergraduate student, such as major and year. 6. Create a subclass called Graduate that inherits from the Student class. The subclass should have additional properties and methods specific to a graduate student, such as research area and thesis topic. Deliverables: 1. The Python program that implements the menu-driven program with pickling and object-oriented programming with inheritance using the Student class that aggregates an Address class and two subclasses (Undergrad and Graduate). 2. A brief write-up explaining the design choices you made and the challenges you faced while completing the assignment. 3. A sample data file that contains a few student records. Note: Make sure to test your program thoroughly and include appropriate error handling. You may use the following UML for your reference Student - StudentID : Integer - stdFirstName: String - stdLastName: String - stdMarks : Double [] - stdAddress: Address ** Class Student should have set/get properties for its private parameters, constructor and have following methods: Average() - that returns the average grade for students __str__() method that returns the above information as a String *** student ID has to be self generated and increment for every student you are adding Address - streetInfo: String - city: String - postalCode: String - province: String - country: String - ** Class Student should have set/get properties for its private parameters, constructor and have following methods: __str__() method that returns the above information as a String Undergrad Student - subject: String - yearOfEntry :Integer - ** Class Student should have set/get properties for its private parameters, constructor and have following methods: - Graduate() Boolean that returns true if the Student is eligible to graduate when the average of their marks is greater than 50. __str__() method that returns the above information as a String 1) Create a class called GraduateStudent that inherits from Student and has the following members: Graduate Student - subject : String - yearOfEntry :Integer - thesisTopic: String - ** Class Student should have set/get properties for its private parameters, constructor and have following methods: Graduate() Boolean that returns true if the Student is eligible to graduate when the average of their marks is greater than 70. __str__() method that returns the above information as a String CAREFUL NOTE: - Please safeguard your code work. - If two or more assignments are the same (or very much alike) they will all get 0 marks, so be cautious not to share your application with others. Upload your py files separately. Marking Scheme: Trait Excellent (85-100) Good (70-85) Satisfactory(50-70) Unsatisfactory (< 50) Delivery (5 marks) Submitted on time and in the correct format. Completed 90 - 100 percent of the program requirements Submitted on time and in the correct format. Completed 75 -90 percent of the program requirements Submitted on time and in the correct format. Completed 70 -80 percent of the program requirements Submitted late or in the wrong format. Completed less than 70% of the program requirements Coding Standards and Documentation (10 marks) Includes name, date and assignment number. Excellent variable names used (no global variables, or vague naming). Useful documentation descriptions. All functions commented. Indented to standard. Includes name, date and assignment number. Appropriate variable names used (little use of global variables, or vague naming). Useful documentation descriptions. Most functions commented. Indented to standard Includes name, date and assignment number. Appropriate variable names used (a few use of global variables, or vague naming). Basic documentation descriptions including purpose for functions. Mostly indented well No name, program description included Poor or misleading variable names used. Little or no indentation. Regular use of global variables Specification and Runtime (75 marks) The program meets all of the specifications required and works. No errors in output. Output is formatted excellently. All requirements met No errors in output. Output is formatted. All requirements met. It also meets most of the other specifications. No errors in output. Output has basic formatting or meets core specifications only. Does not run due to errors, data read incorrectly. Little or no requirement met. Output is poorly formatted or does not follow specifications. Efficiency (10 marks) Algorithm is easy to understand and efficient. Can be maintained or modified with minimal changes Algorithm is easy to understand and efficient Algorithm is easy to understand and but inefficient (excessive use of variables, loops or conditionals) Algorithm is hard to understand and very inefficient (excessive use of variables, loops or conditionals) write in python please according to instructions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Public Finance

Authors: Harvey S. Rosen

3rd Edition

0256083762, 978-0256083767

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago