Question

In: Computer Science

Create an object call Accounts using python for a banking system. Initialize the account with three...

Create an object call Accounts using python for a banking system.
Initialize the account with three data as inputs : Firstname, Lastname and initial deposit. Create 4 additional member functions: Deposit, Withdraw, Fee Calculations, interest
The fee calculation is going to be $14 per month if the total amount in the account is less than $1000. Interest is set to be at 5%.

Solutions

Expert Solution

class Accounts:
   interest = 0
   fee = 0
   def __init__(self, FirstName, LastName, initial_deposit):
       self.FirstName = FirstName
       self.LastName = LastName
       self.balance = initial_deposit
   def Deposit(self, balance):
       self.balance += balance
       print("successfully deposited amount current balance is {}".format(balance))
   def Withdraw(self, balance):
       if(self.balance < balance):
           print("insufficent amount")
       else:
           self.balance -= balance
           print("successfully withdrawn amount current balance is {}".format(balance))
   def FeeCalculation(self, time_in_years):
       if(self.balance < 1000):
           self.fee += 14 * 12 * time_in_years
           self.Interest()
       else:
           self.interest = 0
           print("There is no fee")
   def Interest(self):
       self.interest = 5
person1 = Accounts("firstname1", "lastname1",2000)
person2 = Accounts("firstname2", "lastname2",1000)
person3 = Accounts("firstname3", "lastname3", 500)
person4 = Accounts("firstname4", "lastname3", 5000)

print(person1.balance)
person3.FeeCalculation(1)
print(person3.fee)
print(person3.interest)
person3.Deposit(1000)
person3.FeeCalculation(1)
person4.Withdraw(3000)
print(person4.balance)
print(person2.interest)

If you have any doubts please comment and please don't dislike.


Related Solutions

USING PYTHON Write a program to create a number list. It will call a function to...
USING PYTHON Write a program to create a number list. It will call a function to calculate the average values in the list. Define main ():                        Declare variables and initialize them                        Create a list containing numbers (int/float)                        Call get_avg function that will return the calculated average values in the list.                                       Use a for loop to loop through the values in the list and calculate avg                        End main()
Python - Create/Initialize a dictionary with 5 state/capital pairs of your choosing. The state is the...
Python - Create/Initialize a dictionary with 5 state/capital pairs of your choosing. The state is the key and the capital is the value (e.g. “Kansas”:”Topeka”). Only one statement is needed to do this. - Then prompt the user for a state. e.g. The output Enter a state, and I will display the capital. State: Colorado Colorado's capital is Denver. - If that state exists in the dictionary, display the capital, else display "I'm sorry, but I still need to record...
Using Python create a script called create_notes_drs.py. In the file, define and call a function called...
Using Python create a script called create_notes_drs.py. In the file, define and call a function called main that does the following: Creates a directory called CyberSecurity-Notes in the current working directory Within the CyberSecurity-Notes directory, creates 24 sub-directories (sub-folders), called Week 1, Week 2, Week 3, and so on until up through Week 24 Within each week directory, create 3 sub-directories, called Day 1, Day 2, and Day 3 Bonus Challenge: Add a conditional statement to abort the script if...
In Python Create customer information system as follows: Python 3 Create customer information system as follows:...
In Python Create customer information system as follows: Python 3 Create customer information system as follows: Ask the user to enter name, phonenumber, email for each customer. Build a dictionary of dictionaries to hold 10 customers with each customer having a unique customer id. (random number generated) Take the keys of the above mentioned dictionary which are customer ids and make a list. Ask the use to enter a customer id and do a binary search to find if the...
Using C++. Please number the answers for clarity 1. Create an Account object named as myAccount...
Using C++. Please number the answers for clarity 1. Create an Account object named as myAccount and initialize it with appropriate data. 2. Change myAccount’s interest rate to 1% 3. display the balance on myAccount. 4. Declare a pointer variable ptr and initialize it with the address of myAccount. Display the interest earned on myAccount by using pointer ptr. 5. Dynamically allocate an array of five Account objects. 6. Suppose  getAcctNum() returns the account number of a given Account variable.  Write a...
Create three Python examples using the following patterns: Factory, Facade, and Singleton.
Create three Python examples using the following patterns: Factory, Facade, and Singleton.
Using eclipse IDE, create a java project and call it applets. Create a package and call...
Using eclipse IDE, create a java project and call it applets. Create a package and call it multimedia. Download an image and save it in package folder. In the package, create a java applet where you load the image. Use the drawImage() method to display the image, scaled to different sizes. Create animation in Java using the image. In the same package folder, download a sound. Include the sound in your applets and make it repeated while the applet executes....
PYTHON Which of the following are valid ways to create a DNASeq object for the DNA...
PYTHON Which of the following are valid ways to create a DNASeq object for the DNA sequence, GATCGATCGATC? (Select all that apply.) DNA_seq = new Seq("GATCGATCGATC") DNA_seq = Seq(IUPACUnambiguousDNA() ,"GATCGATCGATC") DNA_seq = Seq("GATCGATCGATC") DNA_seq = Seq("GATCGATCGATC", IUPACUnambiguousDNA())
Using a Python environment of your choice – Create the following three dictionaries: Gary, Alice, and...
Using a Python environment of your choice – Create the following three dictionaries: Gary, Alice, and Tyler Gary = { "name": "Gary", "homework": [90.0,97.0,75.0,92.0], "quizzes": [88.0,40.0,94.0], "tests": [75.0,90.0] } Alice = { "name": "Alice", "homework": [100.0, 92.0, 98.0, 100.0], "quizzes": [82.0, 83.0, 91.0], "tests": [89.0, 97.0] } Tyler = { "name": "Tyler", "homework": [0.0, 87.0, 75.0, 22.0], "quizzes": [0.0, 75.0, 78.0], "tests": [100.0, 100.0] } Insert one additional (new) dictionary of your choice Create a new list named students that...
Using a Python environment of your choice – Create the following three dictionaries: Gary, Alice, and...
Using a Python environment of your choice – Create the following three dictionaries: Gary, Alice, and Tyler Gary = { "name": "Gary", "homework": [90.0,97.0,75.0,92.0], "quizzes": [88.0,40.0,94.0], "tests": [75.0,90.0] } Alice = { "name": "Alice", "homework": [100.0, 92.0, 98.0, 100.0], "quizzes": [82.0, 83.0, 91.0], "tests": [89.0, 97.0] } Tyler = { "name": "Tyler", "homework": [0.0, 87.0, 75.0, 22.0], "quizzes": [0.0, 75.0, 78.0], "tests": [100.0, 100.0] } Insert one additional (new) dictionary of your choice Create a new list named students that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT