• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finance.java Program  RSS feed

 
Surjit Singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have to write methods that perform financial calculations. Interest rates will be expressed as percentages out of 100. For example, 2.45% will be expressed as the number 2.45, not 0.0245. If you detect an error condition, return -1.

public static double computeApy(double annualRate, int compoundingOption): Compute the Annual Percentage Yield (APY) on a deposit account using the following formula: APY formula (use the first formula listed on this page). The compounding option can be one of the following values:
1 -> daily
2 -> monthly
3 -> annually
public static double computeLoanPayment(double principal, double annualRate, double yearsDuration, int paymentOption): Compute the periodic payment needed to repay a loan, using the following formula: periodic payment formula. The payment option can be one of the following values:
1 -> biweekly (every two weeks - assume a year is exactly 52 weeks)
2 -> monthly
3 -> quarterly (four times a year)

And we are not allowed to use IO to ask the user for the information. Please help me with this assignment.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With such a broad question, you can really only expect broad answers. So:

  • plan it out on paper first.
  • write in small chunks
  • compile and test OFTEN - every 2-3 lines at most
  • When you are done testing, test more.


  •  
    Campbell Ritchie
    Marshal
    Posts: 56545
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ... and welcome to the Ranch
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!