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
-
I updated my ipad mini to ios7 and after that the restrictions have been turned on automatically. It was off before the update and I din do after either. I tried 1234 but it doesn't work. Please help me.
1. It is never a good idea to include personal info like your email address or Apple ID in a post on an open forum.
2. The email you received DOES NOT say your Apple ID cannot be used to unlock this iPad. The email informs you that your Apple ID was used to unlock an iPad. Fortunately the iPad is yours. The message confirms that. If your Apple ID was used to unlock an iPad that was not yours your would then know to change your password. Since the iPad is yours you do not need to change your password.
Is your iPad working? -
my ipad is on an infinite loop. I used ios7 for a few days and then did updates on some of my apps. that's when the infinite loop started. I have tried pressing the power and home button at the same time, but it doesn't work. Please help!
I even tried some hints posted for ios6 (turn off Ipad, holding home button and plugging in power cord at the same time and then releasing the home button)
I did manage to get a different screen that shows the itunes icon and a power cord, but nothing happens.You were on the right track. You got the connect to iTunes screen and you ended to use iTujes to restore your iPad. Try recovery mode again.
Recovery Mode Instructions
Disconnect the USB cable from the iPad, but leave the other end of the cable connected to your computer's USB port.
Turn off iPad: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for iPad to turn off.
If you cannot turn off iPad using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the iPad turns off, release the Sleep/Wake and Home buttons.
While pressing and holding the Home button, reconnect the USB cable to iPad. When you reconnect the USB cable, iPad should power on.
Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears you can release the Home button.
If necessary, open iTunes. You should see the recovery mode alert that iTunes has detected an iPad in recovery mode.
Use iTunes to restore iPad. -
I've got a touch iPod and for about a week now it's almost been permenently zoomed into the screen? I actually cannot get it to zoom back out. I've tried pulling the screen out with my fingers but that doesn't work. It's zoomed in on my home pages, on my music, settings everything! It makes simple things like deleting a number from my password login extreamly differcult. Please can someone help?!?! Thanks.
Double tap the screen with three fingers to un-zoom.
Then go to Settings > General > Accessibility > Zoom and turn this OFF. -
I restored my ipod and now the Nike app is crashing on me. I've tried turning it off and on again, but it still doesn't work. Please help.
Hi,
Have you tried a Reset...
Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
The Apple logo will Appear and then Disappear...
Usually takes about 15 - 20 Seconds...
Release the Buttons... -
I have just downloaded a £55 app but it doesn't work, help please???
I have just downloaded an app but when I open it It just comes up with a white screen. I have no idea how or where to go to try and reinstal it, at £55 I do not want to have to re-pay for it, can somebody help me please.
Hi..
Helps to tell us which app you downloaded ...
You can try re downloading. You will not be charged again.
How to re download apps from the Mac App Store:
Open the App Store. From the menu bar click Store > Sign In
Click Purchases from the top of the App Store window.
Select which apps you want to re download. Then right or control click where you see Installed then click Install.
Make sure and use the same Apple ID used for the original purchase.
If that didn't help, if you have anti virus software installed, disable that.
Turn off the Firewall in System Preferences > Security & Privacy
If you have an app called Little Snitch installed, that can prevent apps from downloading. -
HT201210 how could i restore like this but there is not working so please help me
Hey friend. i always ask you how could i restore like this is ipad 2, 4 but there is not working so please help me. If you can hlep me then please sending me to my email. Email is [email protected]
Post in your native language and provide details of what occurs when trying to update.
You have yet to provide sufficient information for anyone to offer relevant assistance to resolve whatever issue is occurring. -
I have a printer epson TX210, but it doesn't work with my time-capsule. What need to do?
What have you tried?
You are going to get nowhere quick with the 6.1 utility in Mountain Lion if this is the only OS you have available.
Look up how to install 5.6 utility under ML. At least then you can see printers. That is assuming you are trying to use USB.
Has this worked ever on Mountain Lion? Did you download the drivers for that printer for ML?
Plug it into a computer directly.. does it work? If it doesn't work locally it sure will not work via the network. -
I try to install this app on my phone but it doesn't install but my friends have it on their phone and it works perfectly
Hi,
I'm sorry you are having this problem installing Firefox for Android. Is it possible that you don't have enough available space for the app? It requires 15Mb of available space to install. If you can give me a bit more information about what happens when you try to install it, I can try to provide some more suggestions.
Thanks,
Michelle -
What apple email program works with OSX 10.6.7? I have Apple mail 4.4, but it doesn't work with OSX 10.6.7?
The reason you're seeing this is that you have somehow gotten an outdated copy of Mail on your system. One possible reason is that you moved Mail out of the Applications folder (or into a sub-folder inside the Applications folder), in the process preventing it from being updated. You'll want to put Mail back directly in the Applications folder if this is the case. The other possibility is that you have somehow installed, restored or copied an old copy of Mail on your machine.
In either case, as long as Mail is in the right place, applying the combo updater will update Mail to the current version. Software Update cannot do that because Software Update sees that you are using the current version of the OS and believes there is no need to update, while the combo updater "forces" installation of all updated files. -
I accidentally put a passcode lock on my iPhone and I forgot what I set for it, is there a way to take it off without accessing the phone? I have restored my phone but it doesn't work, is there anybody that could help me please?
You can't "accidentally" put a passcode on any iPhone...its a multi-step process. Further, restoring an iPhone will remove the passcode, as the passcode is not included in an iPhone backup.
Are you sure you're talking about the phone passcode & not something else...like the "Restrictions" passcode? -
i upload my iPhone 4s and it went to recovery mode i have tried to exit recovery mode by pressing the home and the power bottom but it doesn't work what more can i do please help me
http://support.apple.com/kb/ht1808
-
Within music Library can anyone please explain why after I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums? How can I fix this? I have tried to manually correct by 'drag and drop' individual tracks but that doesn't work. My music library includes a number of repeat album artwork images simply because not all tracks are being listed under the one album making my library more difficult to use than it should. Any advise would be appreciated.
See Grouping tracks into albums.
tt2 -
Help - I turn my Apple air on and get a message asking for my keychain password - I enter my password but it doesn't work. I've never seen this before. What do I do?
This may help.
http://support.apple.com/kb/TS5362?viewlocale=en_US -
I have a huge problem! I've forgot my Ipod touch password, so I tried it a few times! Now my Ipod is disabled. So I affiliated the ipod to itunes but it doesn't work, I can't restore it! So what should I do?
Place the iPod in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
iOS: Wrong passcode results in red disabled screen
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
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
-
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