This is what i have but it doesn't work.Ideas please.

Title:Emile's Project.
public abstract class BankAccount
//constructor
public void BankAccount(double nInitialBalance)
//Abstract Methods:
getCurrentRate:
Returns the Current Interest Rate.
Return Data Type: double
Arguments: None
abstract double getCurrentRate();
/*setRate: Sets Interest Rate
Return Data Type: void
Arguments: double nNewRate
abstract void setRate(double nNewRate);
getDeposit: Add money to the account
Return Data Type: void
Arguments: double nAmount
abstract void getDeposit(double nAmount);
applyWithdrawal: Take Money Out
Return Data Type: void
Arguments: double nAmount
abstract void applyWithdrawal(double nAmount);
getBalance: Returns the Current Balance
Return Data Type: double
Arguments: None
abstract double getBalance();
applyFee: Reduce Current Balance
Return Data Type: void
Arguments: Overloaded method
applyFee(): Applies default fee
applyFee(double nNewRate):Applies custom fee
//apply default fee
abstract void applyFee();
//custom fee
abstract void applyFee(double nNewRate);
applyInterest: Add Interest to the Balance
Return Data Type: void
Arguments: None
abstract void applyInterest();
package banking;
public class CheckingAccount extends BankAccount
private double balance = 0;
private double interestRate = 0.02;//default rate
public CheckingAccount(double nInitialBalance)
this.balance = nInitialBalance;
public void applyInterest()
//apply interest only if balance > 0
if(balance > 0)
// calculate interest value: interest rate * balance
double valInterest = interestRate * balance ;
//calcualte new balance : add interest value to balance
balance += valInterest;
/*applyFee: Reduce Current Balance
Return Data Type: void
public void applyFee(double fees)
//apply custom fees
this.balance -= fees;
getDeposit: Add money to the account
Return Data Type: void
Arguments: double nAmount
public void getDeposit(double nAmount)
balance += nAmount;
getCurrentRate:
Returns the Current Interest Rate.
Return Data Type: double
Arguments: None
public double getCurrentRate() {
return this.interestRate;
applyWithdrawal: Take Money Out
Return Data Type: void
Arguments: double nAmount
public void applyWithdrawal(double nAmount) {
this.balance -= nAmount;
/*setRate: Sets Interest Rate
Return Data Type: void
Arguments: double nNewRate
public void setRate(double nNewRate)
this.interestRate = nNewRate;
public double getBalance() {
return this.balance;
applyFee: Reduce Current Balance
public void applyFee()
// Fees for checking balance under $20 is $15.
if(this.balance < 20)
this.balance -= 15;
package banking;
import java.io.*;
public class FinalProject {
public FinalProject() {
public static void main(String[] args)throws IOException
File outputFile = new File("accountactivity.txt"); //file : account
activity report
FileWriter out = new FileWriter(outputFile);//file writer object
String message = new String(); //account activity item
// array of Months from Jan 2000, to Jan 2001
String arrayMonths [] ={"JANUARY, 2000", "FEBRUARY, 2000","MARCH,
2000","APRIL, 2000","MAY,2000","JUNE, 2000", "JULY,
2000","AUGUST,2000","SEPTEMBER, 2000","OCTOBER, 2000", "NOVEMBER, 2000",
"DECEMBER, 2000", "JANURAY, 2001"};
//Savings account 123 : starting jan 2000
//deposit : $50 : from January 2000 to Jan 2001 : 13 months
//create a new instance of a SavingsAccount with a initial balance of
$100
SavingsAccount savingsAcct123 = new SavingsAccount(100);
//create message : account activity item
message = "==========START: ACTIVITY FOR SAVINGS ACCOUNT 123
================ \n";
//Print the account acticvity to output file
out.write(message);
message = "Savings Account 123 - Initial Balance :$" +
savingsAcct123.getBalance()+'\n';
out.write(message);
for(int i=0; i < arrayMonths.length; i++)
savingsAcct123.getDeposit(50);
//System.out.println("Savings Account 123 - Deposit "
+arrayMonths[i] +": $"+ 50);
message = "Savings Account 123 - Deposit " +arrayMonths[i] +": $50
\n";
out.write(message);
// Apply custom fees of 55$ on february 2000
if(i == 1)
//Apply custom fee : call method :applyFee(double fee)
savingsAcct123.applyFee(55);
message = "Savings Account 123 - Apply Custom fees : $55 on
february 2000 \n";
out.write(message);
// apply default fees :call method :applyFee()
savingsAcct123.applyFee();
//Apply default interest: call savingsAccount's method
savingsAcct123.applyInterest();
message = "Savings Account 123 - Balance "+arrayMonths[i] +" : $"+
savingsAcct123.getBalance() +'\n';
out.write(message);
message = "========== END: ACTIVITY FOR SAVINGS ACCOUNT 123
================ \n";
out.write(message);
//Checking account 123
message = "\n ==========START: ACTIVITY FOR CHECKING ACCOUNT 123
================ \n";
out.write(message);
CheckingAccount checkAcct123 = new CheckingAccount(200);
message = "Checking Account 123 - Initial Balance :"+
checkAcct123.getBalance()+'\n';
out.write(message);
for(int i=0; i < arrayMonths.length; i++)
//Special processing for May : Withdrew $190
if(i == 4)
checkAcct123.getDeposit(100);
message = "Checking Account 123 - Deposit " +arrayMonths[i] +":
$100 \n";
out.write(message);
checkAcct123.applyWithdrawal(190);
message = "Checking Account 123 - Withdrawal " +arrayMonths[i]
+": $190 \n";
out.write(message);
//Apply custom fees
checkAcct123.applyFee(75);
message = "Checking Account 123 - Apply Custom fees : $75 on May
2000 \n";
out.write(message);
//Apply default fees
checkAcct123.applyFee();
//Apply interest
checkAcct123.applyInterest();
message = "Checking Account 123 - Balance "+arrayMonths[i] +" :
$"+ checkAcct123.getBalance();
out.write(message);
out.write('\n');
//Special processing for June : Deposited $200
else if(i == 5)
checkAcct123.getDeposit(200);
message = "Checking Account 123 - Deposit " +arrayMonths[i] +":
$200 \n";
out.write(message);
checkAcct123.applyWithdrawal(70);
message = "Checking Account 123 - Withdrawal " +arrayMonths[i]
+": $70 \n";
//Apply custom fees
checkAcct123.applyFee(45);
message = "Checking Account 123 - Apply Custom fees : $45 on June
2000 \n";
//Apply default fees
checkAcct123.applyFee();
//Apply interest
checkAcct123.applyInterest();
message = "Checking Account 123 - Balance "+arrayMonths[i] +" :
$"+ checkAcct123.getBalance();
out.write(message);
out.write('\n');
else
checkAcct123.getDeposit(100);
message = "Checking Account 123 - Deposit " +arrayMonths[i] +":
$100 \n ";
out.write(message);
checkAcct123.applyWithdrawal(70);
message = "Checking Account 123 - Withdrawal " +arrayMonths[i]
+": $70 \n";
out.write(message);
//Apply default fees
checkAcct123.applyFee();
//Apply interest
checkAcct123.applyInterest();
message = "Checking Account 123 - Balance "+arrayMonths[i] +" :
$"+ checkAcct123.getBalance();
out.write(message);
out.write('\n');
}//end if
}//end for
message ="==========END: ACTIVITY FOR CHECKING ACCOUNT 123
================ \n";
out.write(message);
//Savings account 523 : starting jan 2000
SavingsAccount savingsAcct523 = new SavingsAccount(200);
//System.out.println("Balance : "+savingsAcct523.getBalance());
//deposit : $50 : from January 2000 to Jan 2001 : 13 months
message = " \n ==========START: ACTIVITY FOR SAVINGS ACCOUNT 523
================ \n";
out.write(message);
message = "Savings Account 523 - Initial Balance :$" +
savingsAcct523.getBalance();
out.write(message);
out.write('\n');
for(int i=0; i < arrayMonths.length; i++)
savingsAcct523.getDeposit(30);
message = "Savings Account 523 - Deposit " +arrayMonths[i] +": $50
\n";
out.write(message);
//Apply default fees
savingsAcct523.applyFee();
//apply custom fees : $125 on April 2002
if(i==3)
savingsAcct523.applyFee(125);
message = "Savings Account 523 - Apply Custom fees : $125 on April
2000 \n ";
out.write(message);
//Apply interest
savingsAcct523.applyInterest();
message = "Savings Account 123 - Balance "+arrayMonths[i] +" : $"+
savingsAcct523.getBalance();
out.write(message);
out.write('\n');
message = "========== END: ACTIVITY FOR SAVINGS ACCOUNT 523
================ \n";
out.write(message);
//Checking account 523 : starting jan 2000
CheckingAccount checkingAcct523 = new CheckingAccount(250);
//System.out.println("Balance : "+checkingAcct523.getBalance());
//deposit : $50 : from January 2000 to Jan 2001 : 13 months
message =" \n ==========START: ACTIVITY FOR CHECKING ACCOUNT 523
================ \n";
out.write(message);
message = "Checking Account 523 - Initial Balance :$" +
checkingAcct523.getBalance();
out.write(message);
out.write('\n');
for(int i=0; i < arrayMonths.length; i++)
checkingAcct523.getDeposit(400);
message = "Checking Account 523 - Deposit " +arrayMonths[i] +": $400
\n";
out.write(message);
checkingAcct523.applyWithdrawal(300);
message = "Checking Account 523 - Withdrawal " +arrayMonths[i] +":
$300 \n";
out.write(message);
//Apply fees
checkingAcct523.applyFee();
//Apply custom fees : $85 on July 2000
if( i == 6)
checkingAcct523.applyFee(85);
message = "Checking Account 523 - Apply Custom fees : $85 on July
2000 \n ";
out.write(message);
//Apply interest
checkingAcct523.applyInterest();
message = "Checking Account 523 - Balance "+arrayMonths[i] +" : $"+
checkingAcct523.getBalance();
out.write(message);
out.write('\n');
message = "========== END: ACTIVITY FOR CHECKING ACCOUNT 523
================ \n";
out.write(message);
//Savings account 723 : starting jan 2000
SavingsAccount savingsAcct723 = new SavingsAccount(50);
message = "\n ==========START: ACTIVITY FOR SAVINGS ACCOUNT 723
================ \n";
out.write(message);
message = "Savings Account 723 - Initial Balance :$" +
savingsAcct723.getBalance();
out.write(message);
out.write('\n');
//deposit from January 2000 to Jan 2001 : 13 months
for(int i=0; i < arrayMonths.length; i++)
//July extra deposit 225
if(i == 6)
savingsAcct723.getDeposit(225);
message = "Savings Account 723 - Deposit " +arrayMonths[i] +": $225
\n";
out.write(message);
//apply custom fees $95 on july 2000
savingsAcct723.applyFee(95);
message = "Savings Account 723 - Apply Custom fees : $95 on July
2000 \n ";
out.write(message);
savingsAcct723.getDeposit(25);
message = "Savings Account 723 - Deposit " +arrayMonths[i] +": $25
\n";
out.write(message);
//Apply default fees
savingsAcct723.applyFee();
//Apply interest
savingsAcct723.applyInterest();
message = "Savings Account 723 - Balance "+arrayMonths[i] +" : $"+
savingsAcct723.getBalance();
out.write(message);
out.write('\n');
message = "========== END: ACTIVITY FOR SAVINGS ACCOUNT 723
================ \n";
out.write(message);
//Checking account 723 : starting jan 2000
CheckingAccount checkingAcct723 = new CheckingAccount(150);
message = "\n ==========START: ACTIVITY FOR CHECKING ACCOUNT 523
================ \n";
out.write(message);
message = "Checking Account 523 - Initial Balance :$" +
checkingAcct723.getBalance();
out.write(message);
out.write('\n');
for(int i=0; i < arrayMonths.length; i++)
checkingAcct723.getDeposit(330);
message = "Checking Account 723 - Deposit " +arrayMonths[i] +":
$330 \n";
out.write(message);
checkingAcct723.applyWithdrawal(320);
message = "Checking Account 723 - Withdrawal " +arrayMonths[i] +":
$320 \n";
out.write(message);
//Apply default fees
checkingAcct723.applyFee();
//Apply custom fees $105 on December 2000
if(i == 11)
checkingAcct723.applyFee(105);
message = "Checking Account 723 - Apply Custom fees : $105 on
December 2000 \n";
out.write(message);
//Apply interest
checkingAcct723.applyInterest();
message = "Checking Account 723 - Balance "+arrayMonths[i] +" : $"+
checkingAcct723.getBalance();
out.write(message);
out.write('\n');
message ="========== END: ACTIVITY FOR CHECKING ACCOUNT 723
================ \n";
out.write(message);
//close file outputstream
out.close();
}//end main
}//end class
package banking;
public class SavingsAccount extends BankAccount
private double balance = 0;
private double interestRate = 0.04; // 4% default rate
public SavingsAccount(double nInitialBalance)
this.balance = nInitialBalance;
public void applyInterest()
//apply interest only if balance is > 0
if(balance > 0)
// calculate interest value : balance * interest
double valInterest = balance * interestRate;
//add interest value to balance
balance += valInterest;
public void applyFee(double fees)
//apply custom fees
this.balance -= fees;
public void getDeposit(double nAmount) {
this.balance += nAmount;
public void setDeposit(double nAmount) {
this.balance += nAmount;
public double getCurrentRate() {
return this.interestRate;
public void applyWithdrawal(double nAmount) {
this.balance -= nAmount;
public void setRate(double nNewRate) {
this.interestRate = nNewRate;
public double getBalance() {
return this.balance;
public void applyFee()
// Fees for savings balance under $40 is $10.
if(this.balance < 40)
this.balance -= 10;

It's Emile's fault for abandoning his original posting where he had explained everything (and received ample input from others). His time is more important than yours, so start coughing up the answers, and make it snappy.

Similar Messages

Maybe you are looking for

  • Can't see Adobe Bridge for Download in Creative Cloud

    I recently subscribed to Adobe Creative Cloud, but cannot find Adobe Bridge which I was told is part of the downloadable software.  Looking online, it does seem to be part of the list of downloadabse software for my subscription.

  • Cant get ipod game to work on ipod

    can't get click wheel ipod game to work on my ipod. all the instructions say is to sync it to my ipod but i'm pressing syncc and the game is not syncing and the games tab is not showing, and i cant drag and drop the games. the games are : Pirates of

  • Duplicate Entries in Library

    In the process of trying to move my itunes library to an external drive, I've ended up with duplicate entries for each file. Both entries play the same file, but when one entry is deleted from the library, the file gets deleted, and the remaining ent

  • Lost bootcamp windows disk partition after mountain lion installation

    Greetings all! So I've had Bootcamp (windows 7 and snow leopard, 125gb of hard drive storage on each) on this MacBook Pro (late 2010) for over 2 years and I decided to upgrade to mountain lion. As we all know that we can partition the disk under wind

  • Use of Invoice Rounding Account

    Hi, We are on R12.0.6 We have setup AA rules for invoicing where we have specified invoice rounding account. When we are generating invoices, those are having decimal places. We want total amount of invoice to be rounded to earlier / next interger. L