辅导案例-CMPSC-132

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
CMPSC-132: Programming and Computation II
Fall 2019


Homework 2
Due Date: 10/11/2019, 11:59PM ** You might upload by 10/13 with no penalty
100 pts

Read the instructions carefully before starting the assignment. Make sure your code follows the
stated guidelines to ensure full credit for your work.

Instructions:
- The work in this assignment must be completed alone and must be your own.
- This is a free style assignment, there is no starter code. If you need a starting point,
you can use ideas/code from Module 3 Hands On session on Sep 26.

Instructions:
✓ In Module 3 we worked with the classes Person, Account and Bank. Based on the notion of
what a person represents, you will create a program to emulate a basic banking environment
for an instance of the Person class. For example:

>>> p=Person('Amy', '05/16/1986')
>>> acct1=Account(p)

✓ Assignment Guidelines:
o Your code must apply all four basic principles of object-oriented programming
discussed in our video lectures. Skipping one principle will result in a 10 point
deduction from your homework score. If you are using as a base the code written in the
Hands On session, you still need to implement the 4 principles in your own code.
o Your code must also define and use special methods and property methods to enhance
the implementation
o You can use online resources to guide you in your project, however, don’t forget to
reference all your sources. Failing to do so is considered plagiarism.
✓ Documentation Guidelines:
o This is a free style assignment. You will name your classes, methods and attributes as
they fit to your code. Therefore, documenting your code is very important. When
grading, we will read your documentation first before testing your code.
o Every class and method must be properly documented.
▪ You can document your code using a detailed doctest:

def joinedList(n):
"""
>>> joinedList(5)
[1, 2, 3, 4, 5, 5, 4, 3, 2, 1]
>>> joinedList('5')
'error'
>>> joinedList(0)
[0]
"""
▪ Or you can supply a more detailed description:

def isPower(x, y):
"""
Checks if y is a power of x

Parameters:
-----------
x: int
y: int

Returns:
--------
boolean: True is x is a power of y, False otherwise
string: error message for invalid input
"""

General Implementation:
This is a brief general idea of what your program should do. You are allowed (and encouraged) to
implement additional operations from the ones discussed below. Remember that the use of class
decorators, class attributes and special methods can enhance the functionality of your code,
emulating a bank environment as close as possible.

In a bank, a person can be the manager, a teller, an assistant or a costumer. Based on their
classification, they can perform different tasks at the bank. For example, only a manager can
access detailed information of a costumer, delete an account, etc. An assistant can approve a loan,
transfer large amounts of money between accounts, etc. A teller can see some information about
a costumer but cannot delete it or approve loans. A customer can open different types of accounts,
one might have a minimum balance required, one might have fees when withdrawing from an
ATM. A customer can also ask for a loan or a credit card and make monthly payments, deposit
checks or send money to another account.

Grading Percentage:
✓ This assignment will not be auto-graded. Although functionality of your code represents the
bigger piece of your score, proper code organization and a clear documentation are crucial to
get the best score possible.

Functionality - 50%
Format (clear code writing)– 15%
Documentation – 35%

Deliverables:
• Assignment code. If you worked with multiple .py files, make sure you have submitted all
pieces of your work.
• 4 page documentation file in pdf format:
o Page 1 must contain each name, email, PSU id, and, if applicable, collaboration
statement
o Page 2 must contain a brief description of what your code can do (summary)
o Page 3 must contain the hierarchical chart of your class organization (like the chart in
the inheritance video lecture for the Animal class)
o Page 4 must describe in which pieces of code your submission is implementing the 4
basic principles of object-oriented programming.
• Submit your code and summary file (in pdf format) combined into one .zip file named HW2.zip
to the Homework 2 Gradescope assignment before the due date. If you worked with multiple
.py files make sure to include them all.








51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468