Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

just solve class (saving account ) with python Bank Account Application - Programming Exercises You are asked to write an application for online banking, In

just solve class (saving account ) with python
image text in transcribed
image text in transcribed
Bank Account Application - Programming Exercises You are asked to write an application for online banking, In General, the application allows multiple users to create an account, access their bank account, deposit and withdraw money from their account. Phase 1 (Base class) Create a class called Account that has the following attributes and methods: Class attribute: Number of accounts created: customer_total, type int (public). Must be incremented after creating new account. Instance attributes: Account holder name name, type String (private) Account holder balance: balance, type float (private) Methods: Create a constructor that initializes both the account holder name and the balance, where the balance can have a default value of zero. setName(String) setBalance(float) getName(), returns String getBalance(), returns float deposit (float): enables a user to deposit money to his account. The deposit amount must be positive withdraw(float): enables a user to withdraw money from his account. The withdrawn money must not exceed the balance amount. NOTE: Include the business logic in the methods of the class and not in main. _str_(: return a string of the instance attributes' values Phase 2 (Inheritance) The bank has two types of bank accounts, one is called a saving account and the other is called a checking account. Both accounts have the basic customer information of class Account such as, name and balance, as well as class Account methods. In addition, each account type has the following new rules. Extend class Account to include the new features of each account. Checking account is for customers who wish to receive their salaries direct to their account. The account stores the salary amount and it allows customers to withdraw money even if their balance is not sufficient up to an amount equal to half a salary. o Instance attributes Account holder salary: salary, type float (private) o Methods Override constructor with new fields set Salary(float) getSalary() returns float withdraw(), override from class Account. This method allows for overdraft withdraw for an amount of half the customer's salary. _str_), override from class Account, to return the customer's salary in addition to the customer's name, and balance. Saving account is for customers who wish to receive interest on their saving balances. The account has a minimum balance to be eligible for interests. A balance below the minimum amount is charged a certain amount as a service fee. The minimum balance and fees are same for all customers. The interest rate can vary from customer to customer. Class attributes Minimum balance: base, type float (public) Service fees: fees, type float (public) o Instance attributes Interest rate: rate, type double (private) Methods Override constructor with new fields setRate (double), must be >= 1 getRate();returns double calculate Interest() Implementation: The method calculates the interest by multiplying the rate by the balance and add the product to the balance. Before calculating the interest, the program must check if balance is illegible or not. If not, then a message is displayed stating that the balance is below the base amount withdraw(), override from class Account. This method charges fees if withdraw amount causes a balance to be less than a base amount. The fees is subtracted from the balance (balance can be negative) and a statement must display the new balance after charges. _str_(), override from class Account, to return the customer's rate in addition to the customer's name, and balance

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

Give a brief defi ni tion of the terms population and sample.

Answered: 1 week ago

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago