subject

Object Oriented Python Programming Lab Assignment Objectives
Understand what is meant by a class object's type and how the type determines the operators and methods that can be applied to the object.
Know what a constructor does.
Understand how a class corresponds to a namespace such that object method invocations translate to method calls in the same namespace.
Learn how a module corresponds to a namespace and be able to contrast the different ways to import module attributes.
Understand the Application
Your task this lab is to design, implement and test your own class called BankAccount that models a simple bank account. The bank account has a balance that can be adjusted by deposits and withdrawals. Your class will implement this behavior.
Floating-point numbers are approximate values and can lead to rounding errors. As a result, working with floating-point numbers can yield unexpected results. A more reliable way to work with currency calculations is to use the decimal module to work with decimal numbers. Decimal numbers work like a floating-point number, except that they are exact values so that you do not have to worry about the unexpected results that can be introduced by floating-point numbers.
The Program Specification
Write a basic class that simulates a bank account that supports the following options:
Customers can deposit and withdraw funds.
If sufficient funds are not available for withdrawal, a $10.00 overdraft penalty is charged.
Once within a given month, interest can be added to the account. The interest rate can vary every month.
Class BankAccount
Instance Members:
balance
last_interest_date
Instance Methods
constructor - Constructs a bank account with a given balance. Provides the default parameter initial_balance (default balance = Decimal("0.0").
deposit - Deposits money into the account. Takes the parameter amount to deposit.
withdraw - Makes a withdrawal from the account or charges a penalty if sufficient funds are not available. Takes the parameter amount to withdraw.
add_interest - Adds interest once monthly to a positive account balance. Takes the parameter rate that represents the current rate of interest (for allowable rate of interest 1% <= rate <= 2%). Monitor the date and only apply the rate calculation once monthly.
get_balance - Returns the current account balance.
Input Error Checking: Mutators must validate parameter data before writing to private instance fields. If parameter data is invalid there is no change in state of the bank account.
Testing Requirements
Testing Specification
Test Run Requirements: Provide a test driver that includes at minimum the following actions in the order as shown below:
Instantiate a bank account with an original balance of $1000.00
Deposit $500.00
Withdraws $2000.00
Adds 1% interest
Adds 2% interest
Deposit $125,000.99
Withdraws $0.99
Withdraws $126,500.00
Withdraws $10.00
Adds 1% interest
Show the account balance after each action.
Your test driver will need to import your class.
Example:
from yournameBank import BankAccount
Example: Ann Foothill would import her BankAccount class into the test driver as follows:
from annFoothillBank import BankAccount
Tips and Requirements
Here are some other tips and requirements:
Here are some tips and REQUIREMENTS:
1. Always use self for the first argument to instance methods.
2. Use Decimal values for the balance.
3. Use named constants versus literal values. Note: Use UPPER_UNDER format to define named constants.
Example:
OVERDRAFT_FEE = Decimal(10.0)
4. Format currency output display values to 2 decimal places. Supply the $ symbol. Reflect negative balances as -$ (i. e. -$10.00). Display thousands separators.
More:
Be sure that all output is descriptive.
No user input should be done in this program.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:50
Python write an expression that executes the loop body as long as the user enters a non-negative number. note: if the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "program end never reached." the system doesn't print the test case that caused the reported message. sample outputs with inputs: 9 5 2 -1
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Free points just awnser this. what should i watch on netflix
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
You know the right answer?
Object Oriented Python Programming Lab Assignment Objectives
Understand what is meant by a cl...
Questions
question
Mathematics, 22.02.2021 17:30
question
Mathematics, 22.02.2021 17:30
question
Mathematics, 22.02.2021 17:30
question
Physics, 22.02.2021 17:30
Questions on the website: 13722361