Python program -- 2
Budget: $10 – $30 USD
To start with, you have to carefully distinguish between the person.py file and the persons.py file. The first file is where all the persons basic information are handled, where the second file is there to hold a set of these person's objects.
You should start by implementing the person.py file. Many methods are either implemented for you or you are given a skeleton. Any comment that says "Fix Me" should be reimplemented.
To completely fix the Person class, you have to fix the method in the util.py file. There is a test file name test_util.py given just for this task. Also, you are given full instructions on the util file itself.
Next, you should move to the persons.py file. There two methods that needs fixing. The first is given (remove). Follow the instructions given to implement it correctly. The other methods (append) is not given at all. However, there is a comment that describes what it should do.
Now you have the Model files fixed. Next, you should move to the controller file. You are given an example on how to add as student information. You need to do the same for the faculty case.
The CLI class is almost completely given for you. All you need to add is the key for the fourth case "remove person". Use all the information given to you in the class to understand how the system as a whole works.
When you have completed these steps, all the test cases should succeed. Note that this is not an ironclad guarantee that your code is correct. We will use a few more tests, which we do not share with you, in grading. Our extra tests help ensure that you are really solving the problem and not taking shortcuts that provide correct results only for the known tests.
In addition to passing all test cases, you should also adhere to our coding style principles. You should always refer to the coding style cheat sheet. However, one of the essential representations we agreed on is to give the hints types. For example, when we say a self method foo should take two integers x and y, and return a string. The expected method signature should look like this def foo(self, x: int, y: int) -> str:. As always, when in doubt, check the PEP8 instructions (which PyCharm follows by default).
You should start by implementing the person.py file. Many methods are either implemented for you or you are given a skeleton. Any comment that says "Fix Me" should be reimplemented.
To completely fix the Person class, you have to fix the method in the util.py file. There is a test file name test_util.py given just for this task. Also, you are given full instructions on the util file itself.
Next, you should move to the persons.py file. There two methods that needs fixing. The first is given (remove). Follow the instructions given to implement it correctly. The other methods (append) is not given at all. However, there is a comment that describes what it should do.
Now you have the Model files fixed. Next, you should move to the controller file. You are given an example on how to add as student information. You need to do the same for the faculty case.
The CLI class is almost completely given for you. All you need to add is the key for the fourth case "remove person". Use all the information given to you in the class to understand how the system as a whole works.
When you have completed these steps, all the test cases should succeed. Note that this is not an ironclad guarantee that your code is correct. We will use a few more tests, which we do not share with you, in grading. Our extra tests help ensure that you are really solving the problem and not taking shortcuts that provide correct results only for the known tests.
In addition to passing all test cases, you should also adhere to our coding style principles. You should always refer to the coding style cheat sheet. However, one of the essential representations we agreed on is to give the hints types. For example, when we say a self method foo should take two integers x and y, and return a string. The expected method signature should look like this def foo(self, x: int, y: int) -> str:. As always, when in doubt, check the PEP8 instructions (which PyCharm follows by default).
Related categories:
PHP
Business, Accounting, Human Resources & Legal
Python
Software Architecture
Machine Learning (ML)