The Checking account is interest free and charges transaction fees. The first two monthly transactions are free. It charges a $3 fee for every extra transaction (deposit, withdrawal). The Gold account gives a fixed interest at 5% while the Regular account gives fixed interest at 6%, less a fixed charge of $10. Whenever a withdrawal from a Regular or a Checking account is attempted and the given value is higher than the account's current balance, only the money currently available on the account is withdrawn.
This is a question for Java programming. I have to create a subclass called checkingAccount. It's parent account is the Account class. The account has the withdraw and deposit methods. In the checkingAccount class, I have to have the first two transactions(deposits or withdraws) be free, and every transaction after that charge $3.00. Also, if a withdraw is made that is larger than the current balance, I have to make sure that only the current balance is taken out and nothing more. I have this so far:
public class CheckingAccount extends Account {
private int checkingTransactionCount;
private static final int FREE_TRANSACTION = 2;
private static final double TRANSACTION_FEE = 3;
// Constructs checking account.
public CheckingAccount(Customer customer, int accountNumber, double
balance) {
// Construct superclass
super(customer, accountNumber, balance) ;
int transactionCount = 0;
transactionCount++;
if (transactionCount > 2)
I am stuck here and need help. Thanks.
//If you have any doubt, please ask in the comments
public class CheckingAccount extends Account {
private int checkingTransactionCount=0;
private static final int FREE_TRANSACTION = 2;
private static final double TRANSACTION_FEE = 3;
// Constructs checking account.
public CheckingAccount(Customer customer, int accountNumber, double
balance) {
// Construct superclass
super(customer, accountNumber, balance) ;
}
public void deposit(double money)//please change the method
signature as needed
{
if(this.checkingTransactionCount>this.FREE_TRANSACTION)//if
limit is exceeded
{
money=money-TRANSACTION_FEE;//deduct fee
}
else
{
this.checkingTransactionCount+=1;//else increase the count
}
this.balance+=money;//make deposit
}
public void withdraw(double money)//please change the method
signature as needed
{
if(this.checkingTransactionCount>this.FREE_TRANSACTION)//if
limit is exceeded
{
money=money+TRANSACTION_FEE;//we will deduct more money in that
case
}
else
{
this.checkingTransactionCount+=1;//else increase the count
}
this.balance-=money;//make deposit
if(this.balance<0)//if more money is withdrawn then the
balance
{
this.balance=0;
}
}

The Checking account is interest free and charges transaction fees. The first two monthly transactions are...
Use the Java codes below (Checking Account and Checking Account Demo), and work on these problems. You have to do both of your java codes based on the two provided Java codes. Create one method for depositing and one for withdrawing. The deposit method should have one parameter to indicate the amount to be deposited. You must make sure the amount to be deposited is positive. The withdraw method should have one parameter to indicate the amount to be withdrawn...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package checkingaccounttest; // Chapter 9 Part II Solution public class CheckingAccountTest { public static void main(String[] args) { CheckingAccount c1 = new CheckingAccount(879101,3000); c1.deposit(350); c1.deposit(220); c1.withdraw(100); c1.deposit(1100); c1.deposit(700); c1.withdraw(350); c1.withdraw(220); c1.withdraw(100); c1.deposit(1100); c1.deposit(700); c1.deposit(1000); System.out.println(c1); System.out.println("After calling computeMonthlyFee()"); c1.computeMonthlyFee(); System.out.println(c1); } } class BankAccount { private int...
IN JAVAThe code is attached below has the Account class that was designed to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to deposit and withdraw funds. I need creat program using the 2 java programs.Create two subclasses for checking and savings accounts. A checking account has an overdraft limit, but a savings account cannot be overdrawn.I need to write a test program that creates objects of Account,...
TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. Write a constructor that takes a name and an initial amount as parameters. Itshould call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenatedwith -10 (All checking accounts at this bank are identified by the extension -10). There can be only one...
NOTE: Use the Account class codes in the section below these questions. Modify the main method in the CheckingAccountDemo class: Take out all previous code. Declare an object array with 10 accounts. Create a for loop to ask user to input each account’s information (name, account number, and initial balance) from keyboard and then initialize for each account object. Create a while loop to allow one to work on depositing and withdrawing operations on any account till one want to...
According to the following information, define Account, CheckingAccount, and TestPart1 classes. 1. Account and CheckingAccount classes Account - number: int - openDate: String - name: String - balance: double + Account(int, String, String, double) + deposit(double): void + withdraw (double): boolean + transferTo(Account, double): int + toString(): String CheckingAccount + CheckingAccount(int, String, String, double) + transferTo(Account, double): int Given the above UML diagam, define Account and CheckingAccount classes as follow: Account (8 points) • public Account(int nu, String op, String...
Implement a class Portfolio. This class has two objects, checking and savings, of the type BankAccount. Implement four methods: • public void deposit(double amount, String account) • public void withdraw(double amount, String account) • public void transfer(double amount, String account) • public double getBalance(String account) Here the account string is "S" or "C". For the deposit or withdrawal, it indicates which account is affected. For a transfer, it indicates the account from which the money is taken; the money is...
C++ Design a class bankAccount that defines a bank account as an ADT and implements the basic properties of a bank account. The program will be an interactive, menu-driven program. a. Each object of the class bankAccount will hold the following information about an account: account holder’s name account number balance interest rate The data members MUST be private. Create an array of the bankAccount class that can hold up to 20 class objects. b. Include the member functions to...
Introduction Extend the inheritance hierarchy from the previous project by changing the classes to template classes. Do not worry about rounding in classes that are instantiated as integer classes, you may just use the default rounding. You will add an additional data member, method, and bank account type that inherits SavingsAc-count ("CD", or certicate of deposit). Deliverables A driver program (driver.cpp) An implementation of Account class (account.h) An implementation of SavingsAccount (savingsaccount.h) An implementation of CheckingAccount (checkingaccount.h) An implementation of...
Checking and Savings accounts may not be the only types of accounts. Moreover, different account types may have different rules for withdrawal, interest calculation, etc. To support this, do the following: Create an abstraction (i.e., an interface or abstract class with no concrete implementation) to represent a generic bank account. All bank accounts have an account number, account holder(s) and a current balance. The abstraction must have functions to retrieve all these pieces of information. The abstraction must contain a...