Results 1 to 5 of 5
Thread: Calculate Interest
- 10-08-2010, 03:15 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 35
- Rep Power
- 0
Calculate Interest
On my BankAccount program one of the method should calculate interest as below.
Calculate interest: The interest is compounded daily and is calculated as follows
IN = P(1 + i)n – P (n is power, I could not make it as power visually in here)
Where
IN is interest
P is Principle
i is the daily percentage rate calculated as yearly interest / 365
n is the number of days(I make it 30 on my program to calculate monthly interest)
User will enter the balance and annual interest rate. Here is my method and result. I could not apply this formula to my method correctly because my result in not correct. If you guys give me a hand that I will appreciate you.
Java Code://Interest Calculation public void interest() { interest = balance * Math.pow((1 + annualInterestRate/365), 30)- balance; }Java Code:Enter Your Name: john Enter Your Account Number: 35 Enter Your Begining Balance 200 Enter Your Deposit 100 Enter Your Withraw 200 Enter the Annual Interest Rate 10 Account Holder Name: john Account Number 35 [COLOR="Red"]Account Balance: 100.0 Daily Interest Rate 0.0273972602739726 Monthly Interest 124.98424052172155 Account Balance after Interest Added 224.98424052172155[/COLOR] Process completed.
- 10-08-2010, 03:53 AM #2
What is the value & variable type of annualInterestRate? (Note that it should be a double, otherwise its division by 365 may result in undesired rounding.)
- 10-08-2010, 04:31 AM #3
Member
- Join Date
- Sep 2009
- Posts
- 35
- Rep Power
- 0
value is 10 and data type is double
- 10-08-2010, 04:47 AM #4
If you want it to be a 10% annual interest rate, then its value should be 0.1, not 10.0. When using 10, I get the same number as your program. When using 0.1, I get $0.825191... which seems right.
- 10-09-2010, 04:15 AM #5
Member
- Join Date
- Sep 2009
- Posts
- 35
- Rep Power
- 0
Similar Threads
-
Calculating compound interest using ONLY integers.
By AprilFlowers in forum New To JavaReplies: 2Last Post: 10-21-2009, 06:47 AM -
Help with compound interest program pleaze
By Smirre in forum New To JavaReplies: 1Last Post: 01-19-2009, 09:31 PM -
HELP FAST!!----Interest Calculator
By Coop33 in forum New To JavaReplies: 8Last Post: 10-15-2008, 01:44 PM -
calculating Bank interest rate.
By dotnet007 in forum New To JavaReplies: 10Last Post: 05-13-2008, 09:30 AM -
Calculate what e1 and e2 should be
By Legoland in forum New To JavaReplies: 11Last Post: 07-02-2007, 06:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks