Results 1 to 4 of 4
Thread: Need direction please
- 01-05-2012, 05:51 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 15
- Rep Power
- 0
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("MortgageCalculator");
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));
}
}
- 01-05-2012, 10:21 AM #2
Member
- Join Date
- Jan 2012
- Posts
- 9
- Rep Power
- 0
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.
- 01-05-2012, 12:40 PM #3
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.
- 01-06-2012, 05:45 AM #4
Member
- Join Date
- Feb 2010
- Posts
- 80
- Rep Power
- 0
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
-
Need Direction
By johnjacob in forum New To JavaReplies: 10Last Post: 06-16-2011, 06:45 AM -
I need a little direction for a dictionary app
By Alexis in forum AWT / SwingReplies: 5Last Post: 02-11-2011, 07:43 PM -
random direction
By i8java in forum Threads and SynchronizationReplies: 5Last Post: 04-26-2010, 10:37 PM -
Looking for direction...
By ewomack in forum New To JavaReplies: 4Last Post: 09-13-2009, 11:00 PM -
[SOLVED] Need direction...
By hotice1027 in forum New To JavaReplies: 5Last Post: 11-28-2008, 09:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks