[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Please help me with Laman's terms

Asked by waw9667 in Java Programming Language

Tags: terms, laman

My program is complete and compiles very nicely.  I am on an extremely beginner level and understand some things but most of the things I do, I simply know that I am supposed to do them but do not exactly understand the why nor can I put things into laman's terms to understand them better.  Here is my program and I am asking for just brief explanations for better understanding of my program.  I will put ??? by things I hope someone can better explain.  Thanks a million !!

import java.io.*;
import java.lang.Math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;  // Do I even need this or would java.lang.math be fine without this line ???

public class Mortgages

{
   

    public static void main(String[] args)

    {

            DecimalFormat twoDigits = new DecimalFormat("$###,###.00");

            
        double mortgage = 200000.00;
        double[][] yearsYearlyRate =  //Multiplies term by interest rate

       
        {
            { 7, 15, 30 },            
            { 5.35, 5.5, 5.75 }
        };

       
        double[][] monthsMonthlyRt =

        {
            {
                    yearsYearlyRate[0][0] * 12, yearsYearlyRate[0][1] * 12,
              yearsYearlyRate[0][2] * 12  // Provide brief description please
            },
            {
      // ????? I understand the above but need some clarification of the (1200)              
                    yearsYearlyRate[1][0] / 1200, yearsYearlyRate[1][1] / 1200,
                    yearsYearlyRate[1][2] / 1200
            }
        };


       
        for (int i = 0; i < 3; i++) // brief descriotion please of what this means

        {

            // ??? Please help here
            double payment = calPayment(monthsMonthlyRt[1][i], monthsMonthlyRt[0][i], mortgage);

           

            System.out.println("\nMortgage Amount \tTerm \t\tRate \t\tMonthly Payment");
            System.out.println("$200,000 \t\t" + yearsYearlyRate[0][i] + " years\t"
            + yearsYearlyRate[1][i] + "%\t\t" + twoDigits.format(payment));


            System.out.println("\nPayment # \tMonthly Interest Paid \t\tRemaining Loan Balance");

           
            interestBalanceList(mortgage, monthsMonthlyRt[1][i], monthsMonthlyRt[0][i], payment);

        }

    }

    // I totally do not understand what this entire double tmp or param thing means.  Please help !!!
    public static double calPayment(double param1, double param2, double mortgage) {


               double tmp = 1 + ( param1 ) ;
               for ( int i = 1 ; i < param2 ; i++)
               tmp = tmp * ( 1 + param1 ) ;
               double monthlyPayment = mortgage * tmp * param1 / ( tmp - 1 ) ;

      
       // double monthlyPayment = (param1 + param2 / (Math.pow((1 + param1), param2) - 1)) * mortgage;

              return monthlyPayment;
    }

   
    public static void interestBalanceList(double mortgage, double param1, double param2,
    double payment)

            {

       
              for (int i = 1; i < (param2 + 1); i++)  // Provide brief description please

        {


            System.out.println("Press 'ENTER' to view the loan amortization.");

            try

            {
                System.in.read();     // what exactly is this providing my program ???  Do I even need it ???
            }      catch (Exception e)


            {

            }

            // Calculate the Monthly Interest of the Loan Balance
            double monthlyInterest = mortgage * param1;

            // Calculate the Remaining Loan Balance
            double loanRemaining = mortgage - (payment - monthlyInterest);

            // Set the value of Mortgage Amount to the Value of the Remaining Loan Balance
            mortgage = loanRemaining;

            // Format the Monthly Interest Amount into U.S. Currency
            NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
            String str = n.format(monthlyInterest);

            // Format the Remaining Loan Balance into U.S. Currency
            NumberFormat num = NumberFormat.getCurrencyInstance(Locale.US);
            String string = num.format(loanRemaining);

            // Display the Payment #, Monthly Interest Paid and Remaining Loan Balance


            System.out.println("\n " + i + "\t\t\t" + str + "\t\t\t" + string);  // Please explain the string

        }
    }  // Also, I would like to make the program pause after showing 12 payments on the screen so
       // how would I go about doing this ?????
}
[+][-]08/01/06 10:44 PM, ID: 17230565Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 10:49 PM, ID: 17230584Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/06 10:49 PM, ID: 17230586Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 10:50 PM, ID: 17230593Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java Programming Language
Tags: terms, laman
Sign Up Now!
Solution Provided By: suprapto45
Participating Experts: 2
Solution Grade: A
 
[+][-]08/01/06 10:53 PM, ID: 17230605Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:10 PM, ID: 17230664Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:11 PM, ID: 17230669Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:12 PM, ID: 17230674Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:12 PM, ID: 17230676Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:18 PM, ID: 17230689Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:23 PM, ID: 17230706Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/06 11:28 PM, ID: 17230727Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/02/06 12:22 AM, ID: 17230908Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/02/06 02:38 AM, ID: 17231456Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89