Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please can you solve this question using PYTHON ! only solve phase 2 because i already solved phase 1 Bank Account Application - Programming Exercises

Please can you solve this question using PYTHON ! only solve phase 2 because i already solved phase 1 image text in transcribed image text in transcribedimage 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. O . > 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. Instance attributes Account holder salary: salary, type float (private) Methods Override constructor with new fields set Salary(float) get Salary(), 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. O o . 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) Instance attributes Interest rate: rate, type double (private) Methods Override constructor with new fields setRate (double), must be >= 1 getRate(), returns double calculateInterest () 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. 1 1 Testing: O In the application (main program), create one checking account with the following info: Name: Hasan Balance: 200 Salary: 600 O o Testing scenarios: O o Display account holder info by using the implicit str () method call. Withdraw 300 and display the balance. See if the balance is over drafted. Withdraw another 300 and see if it is allowed this time. O o O Create a saving account with the following info: Name: Salma Balance: 100 Base: 50 Interest: 1.2 Fees: 10 O O o o Testing scenarios: Display account holder info by using the implicit str () method call. Call method calculate Interest() and display the new balance. Withdraw 80 and display the new balance. How about the fees amount? Call method calculate Interest() again and display the balance. Is it changed? o O O

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_2

Step: 3

blur-text-image_3

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions