Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2008, 05:22 PM
Member
 
Join Date: Apr 2008
Location: Bangladesh
Posts: 5
dotnet007 is on a distinguished road
calculating Bank interest rate.
I want to solve interest rate calculation of a Bank.
But i don't know about the algorithm of interest rate calculation for bank.
suppose one customer has a account. ha has 5000US in his account for five month.
so how can i calculate the total interest of 5 months (suppose, monthly interest rate is 0.05 )
Please if any body know about interest calculation of a bank help me...
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-10-2008, 06:44 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 509
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Algorithm? You should know that before converting it to java code.

You can search from the web about it.

come back here and post the algorithm that you have.
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-10-2008, 08:21 PM
Member
 
Join Date: Apr 2008
Location: Bangladesh
Posts: 5
dotnet007 is on a distinguished road
thanks for your reply. i will post the algorithm if i can manage....
Best of Luck
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-12-2008, 10:09 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 173
Eku is on a distinguished road
Please confirm this Algo.

For Annual Interest Rates:
totalAmmount = (BasicAmmount) x ((InterestRateAnnually)^(NumberOfYears))
or in another algo it may look like this. But they are the same.
for (int i-0; i<NumberOfYears; i++){
basicAmmount = (BasicAmmount) + (BasicAmmount * InterestRateAnnually)}

Code:
double CurrMoney=5000,TotalMoney; int years = 5; for (int i=0;i<years;i++){ CurrMoney=CurrMoney + (CurrMoney*0.05); } TotalMoney=CurrMoney;
OR the simplified version
Code:
double CurrMoney=5000,TotalMoney; int years = 5; TotalMoney=CurrMoney * (1+((0.05)^years));

Last edited by Eku : 05-12-2008 at 10:16 AM.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-12-2008, 11:03 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,395
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Much better to avoid loops as much as possible. The second way is much better.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on July 13, 2008)
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-13-2008, 03:11 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 173
Eku is on a distinguished road
The 2nd one is much simplier. Just search on how to use the Exponent. i think '^' doesnt work. =P
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-13-2008, 05:34 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,395
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Yes it is. For exponent you can't use ^ sign. It's just for pseudo codes. If you it's not work, why you put it there

Use Math class for those types of processing.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on July 13, 2008)
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-13-2008, 05:55 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 173
Eku is on a distinguished road
Thanks for the Tip. Here it is now.
Code:
double CurrMoney=5000,TotalMoney; int years = 5; TotalMoney=CurrMoney * (1+(java.lang.Math.pow((0.05),years)));
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 05-13-2008, 06:06 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,395
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Yep it's. But it is not good to import Java packages in runtime. Import them before use, at the top level of any class.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on July 13, 2008)
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 05-13-2008, 10:08 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 173
Eku is on a distinguished road
Thanks for the tips Eranga. Here is the New Code. =)
Code:
package test; import java.lang.Math.*; public class Main { public static void main(String[] args) { double CurrMoney=5000,TotalMoney,years = 5; TotalMoney=CurrMoney * (1+(Math.pow((0.05),years))); System.out.println(TotalMoney); } }
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 05-13-2008, 10:30 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,395
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Ya, it's much better.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on July 13, 2008)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating hyperbolic functions Java Tip java.lang 0 04-16-2008 11:55 PM
Calculating the DB connection time Java Tip Java Tips 0 01-20-2008 09:55 AM
Calculating sin of a double value Java Tip Java Tips 0 01-13-2008 09:13 PM
Code bank Eranga Suggestions & Feedback 2 01-01-2008 06:23 AM
Help MEEEEEEE! bank project subwoofer717 Advanced Java 1 12-25-2007 10:08 AM


All times are GMT +3. The time now is 07:53 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org