Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java programing There will be 4 classes in the project Bank class Account (Abstract) class Accumulation Account class Account Control class 1. Account (Abstract) class:

java programing

There will be 4 classes in the project

Bank class

Account (Abstract) class

Accumulation Account class

Account Control class

1. Account (Abstract) class:

FEATURES:

protected String id;

//account definition

protected double remnant;

// current remnant

CONTRUCTOR:

public account (String id, double remnant)

// Although the abstract class is not used directly, it from the constructor's subclass constructor

Remember to use.

METHODS:

public String getID()

// account id

public double getRemnant ()

// current Remnant

public String toString()

// Returns a string containing the ID and the remnant. For example, if the ID is "Kazim" and the remnant is "150", the returned string is as follows (same punctuation marks and spaces):

ID: Kazim, remnant: 150.00 Number of decimal places at least should be two.

public abstract boolean withdrawmoney (double amount)

// This method allows ATMs and other electronic withdrawals (eg transfer from account to account) It will be applied in lower grades to attract.

public abstract void depositmoney (double amount)

// This method will be applied in subclasses to allow for depositing in ATMs and other electronic deposits (eg transfer from account to account).

2. AccumulationAccount class

The AccumulationHesabi class will be derived from the Account class. Accumulation in the account will be at minimum 10TL at the normal time. This account will allow you to deposit money and withdraw money from ATM machines or electronic accounts. The deposit fee will not be. If a withdrawal is made, a 5TL transaction fee will be charged on the remnant. It will cause the remnant to fall below 10TL

withdrawal will be prevented. The interest amount will be calculated and added to the account by the bank.

FEATURES

There is no need for new features.

CONSTRUCTOR

Public Accumulation (String id, double firstdepositmoney)

// Suppose that the first deposit will be at least 100TL. If the first deposit is 10,000TL or more, the bank will add another 200,00 TL as part of its ongoing promotion. It must be used super to use the code of the account top class.

METHODS

public boolean withdrawmoney(double amount)

// Apply the withdrawal method to receive the amount from the account remnant. Include withdrawals processing fee. No withdrawal is permitted, potentially below 10 TL.The remnant remains unchanged, but METHOD returns FALSE. Returns TRUE if the withdrawal is successful.

NOTE: Note that using a Boolean return value is a bad design. Do not use Java EXCEPTION

public void depositmoney (double amount):

// The provided amount is added to the account as a result of the ATM transaction. No processing fee is charged.

public double interest (double rate):

// Monthly rate, percent by method invocate is given. METHOD calculates remnant interest

and adds the remnant interest. METHOD calculated interest Returns. When to add the calling class should be careful note. calculate interest only on interest method should be aware of the formula used for residual * ratio / 100). For example, a monthly interest rate of 0.20%

if the balance is 20.000 TL, the interest is 400 TL and the new the balance is $ 20400.

3. ACCOUNT CONTROL CLASS

The AccountControl class is derived from the account. This account does not give any interest. It allows depositing and withdrawing from ATMs and electronic transactions, and both are deducted from a remnant of 2TL per transaction. The balance cannot fall below 0 TL using an ATM or electronic transaction. Therefore, the minimum amount that can be invested is 2 TL. Suppose we don't put anything on anything less than that.

The bank card can be used for withdrawals. The use of the first three passbooks in a month is free, but subsequent uses add a charge of $ 2 for each traction. WALLET can make the remnant - 10 TL. One or more WINDERS can reduce the balance to - 10TL, but not lower it. If the use of a WALL could potentially lower the deposit below 10TL, withdrawal with the WALLET is not permitted.

The following wallet usage FEATURES must be performed.

FEATURES

private int number Of Card

// Stores the number of CARDS used every month. It starts at 0 and can be reset using the following METHOD.

CONSTRUCTOR

Public AccountControl (String id, double first remnant)

// assume that the first remnant will not be negative. This constructor must use the super command to use the upper-class code.

METHODS

public boolean withdrawal (double amount):

// To remove the amount from the account remnant

Apply the ATM withdrawal method. ATM / transaction fee for electronic withdrawals

add. A currency that will put the potential below 0 TL drawing is not allowed. In similar cases,

BACKSPACE remains unchanged, but METHOD returns FALSE. If the withdrawal is successful, METHOD TRUE value.

public void depositmoney (double amount):

// Amount provided, At the end of the ATM transaction is added to the account.

Applicable transaction fees are deducted from the remnant.

public void ResetCardUsage ()

//This method resets the number of wallets used in each period

public int NumberofCards()

// This method returns the number of cards used in each period.

4. BANK CLASS

The Bank class maintains information about all accounts in an ArrayList. The Bank class can take a specific account using an account ID and perform deposit and withdrawals. In the AccountControl class, Wallet can perform monthly tasks such as resetting the number of checks and adding interest to Accumulation.

Features:

private ArrayList accounts;

// Arraylist of Accounts (includes all subclasses)

private double savingsInterestRate;

// interest rate in percent for accumulation

CONSTRUCTOR

public Bank()

// initializes the ArrayList with a new one.

METHODS

public void interestratesetting (double rate)

// rate adjusts

public int number of accounts ():

// the number of accounts active in the bank not the capacity of ArrayList accounts)

public void addaccount (Account a)

// Add to account Arraylist

public Account getAccount (String hesapID)

// return the first Account object (which can be a subclass) corresponding to the accountID. If the account is not available for the specified account ID, then return NULL.

public boolean deposit (String accountID, double amount):

// account ID

amount. If the account cannot be found, return false. Otherwise

Deposit and TRUE.

public boolean withdrawal (string accountID, double amount):

// pulls the amount from the account specified by the accountID. If successful, TRUE, if not FALSE (eg, if accountID was not found or withdrawal was unsuccessful).

public boolean transfer (String sender ID, String acceptor ID, double amount)

// withdrawal from the accountID and the deposit specified for the accountID (sender recipient) If both accounts are not found, METHOD should return to FALSE and no deposit / withdrawal should be performed. TRUE if both withdrawal and deposit are successful. If the withdrawal is unsuccessful, do not deposit (even if successful) and vice versa. Returns TRUE if both succeed, otherwise FALSE. Note that this method will use the deposit and withdrawal methods specified in the ABSTRACT Account class. Transfer and handling fees will be applied against withdrawal and deposit applications.

public void interest ()

// Iterate in all accounts and set in the class to the appropriate accounts using the interest rate (ie all Add the Accumulation Phase ratio

public void reset ()

// Iterate to all accounts and valid accounts Reset the number of WALLET for the (eg all Account Control) classes)

TESTING

The final evaluation will be performed using a different set of test cases for all methods.

Main method will not be tested; The methods you apply will be tested directly. Ideally, you must create your own MAIN METHOD, one for each class, to test each class individually.

You can use the bank class in a basic METHOD that tests four classes together.

Below is a sample MAIN METHOD for the Bank class. Please note that in its current form, it does not test all methods. It also does not test for various situations. public static void main (String [] args)

{

Bank bank = new Bank ();

bank.setinterestrate (0.25);

Account a1 = new Accumulation Compensation ("Kazim", 100.00);

Account a2 = new AccountControl ("seda", 50.00);

bank.Accountekl (A1);

bank.Accountekl (A2);

System.out.println ("Number of accounts:" +

bank.Account number of ());

boolean result = bank.withdrawal ("kazim", 20.00);

System.out.println (result);

result = bank.depositmoney ("seda", 20.00);

System.out.println (result);

bank.interest();

System.out.println (bank.getaccount ( "kazim"));

System.out.println (bank.getaccount (the "seda"));

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

=+ (d) Prove for G the analogue of (30.34).

Answered: 1 week ago

Question

Distinguish between poor and good positive and neutral messages.

Answered: 1 week ago

Question

Describe the four specific guidelines for using the direct plan.

Answered: 1 week ago