Results 1 to 2 of 2
Thread: JAVA Help
- 12-04-2013, 10:53 PM #1Banned
- Join Date
- Dec 2013
- Rep Power
I am new to java and need some help. I will try to program myself but need some help with psuedocode below -
Can Someone tell me how do i link BankAccount class with Checking and Savings class
Write a bank account program that handles bank account balances for an array of bank accounts. There are two types of bank accounts ─ checking and savings.
Implement the following classes and methods.
deposit method ─ add the given amount to the current balance.
withdraw method ─ subtract the given amount from the current balance. Don’t allow the balance to go below zero. If the balance does go below zero, change the balance to zero.
display method ─ This must be an abstract method.
No new instance variables.
writeACheck method ─ subtract the given amount from the current balance and then subtract an additional $1 as part of a service fee.
display method ─ print the type of account, checking, and then the balance (with standard currency format). Study the output for details.
intRate (interest rate)
addInterest method ─ calculate the interest by multiplying the intRate by the current balance. Add the interest to the balance.
display method ─ print the type of account, savings, and then the balance (with standard currency format).
Provide appropriate constructors and additional methods as necessary. Study the given main method and output for details. Hint: Don’t allow the balance to go below zero. If the balance does go below zero, change the balance to zero.
Provide a driver class that tests your three classes. Your driver class should contain this main method:
public static void main(String args)
BankAccount accounts = new BankAccount;
accounts = new Savings(1100, .05);
accounts = new Checking(-100);
accounts = new Checking(200);
for (int i=0; i<accounts.length && accounts[i] != null; i++)
} // end main
Savings account balance = $1,050.00
Checking account balance = $50.00
Checking account balance = $49.00
Last edited by smarty84handsome; 12-05-2013 at 06:14 AM.
- 12-05-2013, 02:56 AM #2
Re: JAVA Helphow do i link BankAccount class with Checking and Savings class
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get highlighting and preserve formatting.If you don't understand my response, don't ignore it, ask a question.