Create a class variable and assign an initial value of zero

Assignment Help Python Programming
Reference no: EM132124201

Python Programming Assignment -

You first need an abstract base class, called, Account which has the following attributes and methods:

  • accountID: This attribute holds the ID assigned the account , if not provided set to zero.
  • balance: This attribute holds the initial balance of the account, if not provided set to zero.
  • numberDeposit: This attribute holds the number of deposits this month.
  • numberWithdrawals This attribute holds the number of withdrawals this month.
  • annuallnterest: This attribute holds the annual interest rate.
  • monthlyServiceCharges: This attribute holds the monthly service charges of the account.
  • init: An init method that sets the attributes of the class.
  • deposit: An abstract method that accepts an argument for the amount of the deposit. The method should add the argument to the account balance. It should also increment the variable holding the number of deposits.
  • withdraw: An abstract method that accepts an argument for the amount of withdrawal. This methods should subtract the argument from the balance. It should also increment the variable holding the number of withdrawals.
  • calclnterest: An abstract method that updates the balance by calculating the monthly interest earned by the account, and adding this interest to the balance. This is performed by the following formulas: Monthly Interest Rate = Annual Interest Rate / 12, Monthly Interest = Balance * Monthly Interest Rate and Balance = Balance + Monthly Interest.
  • monthlyProc: An abstract method that subtracts the monthly service charges from the balance, calls the calclnteret method, then sets the variables that hold the number of withdrawals, number of deposits, and monthly service charges to zero.
  • str: Through this method, account ID and balance are displayed.

Next, design a savings account class, called SavingsAccount, derived from the generic Account class. The SavingsAccount class should have the following additional members:

  • status: This attribute represent if account is active or inactive.

If the balance of the savings account falls below $3, it becomes inactive (the status member could be a flag variable). No more withdrawal would be made until the balance is raised above $30, at which time the account becomes active again. The savings account class should have the following methods:

  • init: An init method that inherits from the init method of Account class and also sets the status attribute of the class.
  • deposit: A method that checks if the account is inactive before a deposit is made. If the account is inactive the deposit brings the balance above $30, the account becomes active again. The deposit is then made by calling the base class version of the method.
  • withdraw: A method that checks to see if the account is inactive before a withdrawal is made. No withdrawal is made if the account is inactive. A withdrawals is then made by calling the base class version of the method.
  • monthlyProc: Before the base class method is called, this method checks the number of withdrawal. If the number of withdrawals for the month is more than 4, then a service charge of $2 for each withdrawals above 4 is added to the base class variable that holds the monthly service charges. Don't forget to check the account balance after the service charges are taken. If the balance falls below $30, the account becomes inactive.
  • str: This method prints the account ID, balance, and status.

Next, design a checking account class, also derived from the generic Account class. It should have the following member functions:

  • withdraw: Before the base class method is called, this method will determine if withdrawal will cause the balance falls below $0. If the balance goes below $0, a service charge of $20 will be taken from the account and no withdrawal would be made. If there is not enough to pay the account charges, the balance will become negative and the customer will owe the negative amount to the bank.
  • monthlyProc: Before the base class method is called, this function adds the monthly fee of $5 per withdrawals to the base class variable that holds the monthly service charges.

In the Main.py file, write a complete main function that demonstrates these classes by asking the user to enter the accounts of deposits and withdrawals for a savings and checking account. The program should display statistics for the month, including the beginning balance, total amount of deposits, total amount of withdrawals, service charges and ending balance.

NOTE: You may need t add more member variables and functions to the class than those listed above.

1) You need to create a class variable and assign an initial value of zero to it and update it throughout your program.

2) Yes, it should be decreased meaning that the account holder owes the bank.

3) You don't need to specify a timeline, all transactions assumed to be for the current month and you need to calculate that.

Reference no: EM132124201

Questions Cloud

Surfing the internet to check out all the fascinating links : While working on your homework for this course and surfing the Internet to check out all the fascinating links,
In what ways is monitoring easier : In some ways monitoring is easier in a partnership than a corporation, where shareholders monitor directors. In what ways is monitoring easier?
Characterized as multi-domestic-global or transnational : Is LVMH's international strategy best characterized as multi-domestic, global or transnational?
Give two reasons for taking the argument : Thinking about famous corporate scandals like Enron and WorldCom, some analysts have suggested that these are the tip of the iceberg and that there are many.
Create a class variable and assign an initial value of zero : Python Programming Assignment - You need to create a class variable and assign an initial value of zero to it and update it throughout your program
Indicators of predictions the homeownership : Suppose you perform a multiple regression to predict crime rate in a state and includes as indicators of predictions the homeownership rate divorce rate
What techniques can be used to minimize deadlocks : How does waste increase costs? Give three examples. What techniques can be used to minimize deadlocks, and how?
Do the three firm sizes have the same capital structure : Do the three firm sizes have the same capital structure? Use the 0.10 significance level.a
Disadvantages of full ownership versus joint ventures : Discuss the advantages and disadvantages of full ownership versus joint ventures. Please answer in a complete paragraph.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd