Results 1 to 4 of 4
  1. #1
    kprofgold is offline Member
    Join Date
    Dec 2011
    Rep Power

    Default Need direction please

    Hi I am in a beginning Java class and have to come up with my assignment. It is hard for me to understand how this works through reading and learning on my own through a book. But here is what I am required to do. Write the program in Java (without a graphical user interface) using a loan amount of $200,000 with an interest rate of 5.75% and a 30 year term. Display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan. If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display more of the list..... I understand that you will probably not just give me the answer but I have no clue where to go with this or where to look in my book to continue on. This is all I have so far. ( I am using NetBeans)

    public class MortgageCalculator {

    public static void main(String[] args) {
    double annualInterest = 5.75; //This is the annual interest rate
    double loanAmount = 200000; //This is the loan amount
    double loanLengthInYears = 30; //This is the length of the loan in years

    //Formuals bieng used are:
    double monthlyInterest = annualInterest /100/12;
    double loanLengthInMonths = loanLengthInYears * 12;

    double monthlyPayment = (loanAmount * monthlyInterest) / (1 - Math.pow((1 + monthlyInterest), -loanLengthInMonths));
    DecimalFormat decimalPlaces=new DecimalFormat("0.00");//Rounds up the dollar amount

    System.out.println("Annual Interest: 5.75%");
    System.out.println("Loan Amount: $200,000");
    System.out.println("Loan Length: 30 years");
    System.out.println("Monthly Payment: " + decimalPlaces.format(monthlyPayment));

  2. #2
    bayan.rafeh is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Re: Need direction please

    I recommend this video to introduce you to loops.

    You need to define an number of entries to be entered on one line, say 5 entries per line, and call system.out.println() when you reach five numbers for example.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Need direction please

    Which part is giving you problems?
    Break the task up into small steps and do them one at a time.
    Do a design, enter the code, compile and test for each step. When a step works, move to the next one.

  4. #4
    clydedoris is offline Member
    Join Date
    Feb 2010
    Rep Power

    Default Re: Need direction please

    dude, all you have are declarations and printing.

    Norm's right, you have to break the code into smaller steps.

    try solving the problem in a piece of paper, then create the algorithm and write it in plain english. then try to translate that into code using pseudo-code. we'd at least be more willing to help you then.
    [why are you annoyed with my sig?]

Similar Threads

  1. Need Direction
    By johnjacob in forum New To Java
    Replies: 10
    Last Post: 06-16-2011, 06:45 AM
  2. I need a little direction for a dictionary app
    By Alexis in forum AWT / Swing
    Replies: 5
    Last Post: 02-11-2011, 07:43 PM
  3. random direction
    By i8java in forum Threads and Synchronization
    Replies: 5
    Last Post: 04-26-2010, 10:37 PM
  4. Looking for direction...
    By ewomack in forum New To Java
    Replies: 4
    Last Post: 09-13-2009, 11:00 PM
  5. [SOLVED] Need direction...
    By hotice1027 in forum New To Java
    Replies: 5
    Last Post: 11-28-2008, 09:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts