Page 3 of 3 FirstFirst 123
Results 41 to 47 of 47
Like Tree6Likes

Thread: Incorrect formulas

  1. #41
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default Re: Incorrect formulas

    Quote Originally Posted by santa View Post
    Yeah, there it goes. Help OP and then get shit for it and when I defend myself I'll get banned for it? Nice blow for free speech on internet... So just to be clear if i post boilerplate code I'll get banned?
    With freedom of speech comes responsibility; you didn't take your responsibilites. Together with rights comes obligation. You won't be banned for posting boilerplate code once; we just warned you for it. It's the attitude you have shown afterwards that might get you banned.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  2. #42
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Incorrect formulas

    Quote Originally Posted by JosAH View Post
    With freedom of speech comes responsibility; you didn't take your responsibilites. Together with rights comes obligation. You won't be banned for posting boilerplate code once; we just warned you for it. It's the attitude you have shown afterwards that might get you banned.

    Jos
    Sounds crazy to ban someone for providing a example solution, even if its more than once.
    So let me be clear... you offend me by saying "but you obviously lack any form of scientific insight so you don't understand" and when I defend myself you threaten me by "the attitude you have shown afterwards that might get you banned"? nice one.

  3. #43
    kprofgold is offline Member
    Join Date
    Dec 2011
    Posts
    15
    Rep Power
    0

    Default Re: Incorrect formulas

    I dont mind that you posted that Santa... its an opinion of mine which I dont mind sharing...and it is not easy to just pick up a book and code. That is why we go to school so our instructors can show us examples and teach us which is what I believe you were trying to do. Unfortunately in my case this is my first programming class and its only once a week for 3 hours so its hard to retain so much info in that little time. I didnt mean to cause an uproar in here I just wanted some help. But Ive come up with my assignment which of course isnt perfect but I at least have some results. Take a look if you all want:

    Java Code:
    public class MortgageCalculator3 {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            double loanAmount = 200000; //This is the loan amount
            double monthlyPayment[] = new double[3];//creates the new variable
    
    
            double interest[] = new double[3];
            interest[0] = 5.35;//interest rate for loan 0
            interest[1] = 5.5;//interest rate for loan 1
            interest[2] = 5.75;//interest rate for loan 2
    
            int years[] = new int[3];
            years[0] = 7;//amount of years of loan 0
            years[1] = 15;//amount of years of loan 1
            years[2] = 30;//amount of years of loan 2
    
            for (int x = 0; x <= 2; x++) {
                
                double monthlyInterest = interest[x] / 100 / 12;
                double noOfMonths = years[x] * 12;
                monthlyPayment[x] = (loanAmount * monthlyInterest) / (1 - Math.pow((1 + monthlyInterest), -noOfMonths)); //creates the formula for the loans
    
                //prints loan details
                System.out.println("MortgageCalculator");
                System.out.println("Loan " + x);//displays loan bieng calculated
                System.out.println("Loan Amount: $200,000");//displays loan amount
                System.out.println("Annual Interest Percentage: " + interest[x]);//displays annual interest
                System.out.println("Loan Length In Years: " + years[x]);//displays years in loan
                System.out.println("Monthly Payment: $" + monthlyPayment[x]);//displays monthly payment
                System.out.println("");//creates break 
    
                double interestPayment;
                double currentLoanAmount = loanAmount;
                for (int i = 1; i <= noOfMonths; i++) {   //begins the loop process for 360 payments
    
                    interestPayment = currentLoanAmount * monthlyInterest;
                    currentLoanAmount = (currentLoanAmount - (monthlyPayment[x] - interestPayment));
                    System.out.println("For payment #" + i + ", The Interest Payment is $" + (interestPayment));//displays the results of the interest payment           
                    System.out.println("For payment #" + i + ", The Remaining Balance is $" + (currentLoanAmount));//displays the results of the remaining balance     
    
                }
                System.out.println();//creates space between different loan results
            }
    
        }
    }
    Last edited by JosAH; 01-31-2012 at 07:42 AM. Reason: added [code] ... [/code] tags

  4. #44
    christopherx is offline Member
    Join Date
    Oct 2011
    Posts
    92
    Rep Power
    0

    Default Re: Incorrect formulas

    Maybe it's in everyone's interests to just clarify the two points of the argument :)

    Myself, Jos, Tolls and anyone else who has posted is pretty much saying the same thing. We want them to generate code, ask us for a little nudge and they go away and write more code. We all believe this process helps them come to terms with the axioms behind the code itself.

    Santa is simply saying that an example of how the code works is self explanatory in giving them the concepts necessary.

    Santa, learning by example is one method of teaching, but you didn't learn by example. you posted a solution, with no explanation of how you decided that this solution was the correct one. It IS the output of your thought process, and it isn't the output that is important. It's important that the OP goes on that same thought process, so the concepts that you have obviously already developed can be developed within their minds as well. All the same, the OP was happy with that and in this particular case it might have worked out for the best (I still believe on the contrary, but if OP's happy then what the hell). That still isn't to say that it will work out for the best in all cases. From a statistical, logical and educational point of view, it still makes the most sense to explain the problem, then attempt to get OP to go through it themselves.

    All the same santa, the point of this post was so you see that we get your argument, and you were only trying to help. There are just certain rules that this forum adheres too, in order to make the most educationally beneficial environment!
    Tolls and Fubarable like this.

  5. #45
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: Incorrect formulas

    Quote Originally Posted by santa View Post
    Yeah, there it goes. Help OP and then get shit for it and when I defend myself I'll get banned for it? Nice blow for free speech on internet... So just to be clear if i post boilerplate code I'll get banned?
    There is free speech on the internet.
    No one is stopping you from setting up your own forum.
    The free speech of the internet does not apply to individual forums, though, since each have their own rules.
    One of the ones here is that we don't post boiler plate code.
    christopherx has summarised it pretty well.

  6. #46
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Incorrect formulas

    Quote Originally Posted by christopherx View Post
    Maybe it's in everyone's interests to just clarify the two points of the argument :)

    Myself, Jos, Tolls and anyone else who has posted is pretty much saying the same thing. We want them to generate code, ask us for a little nudge and they go away and write more code. We all believe this process helps them come to terms with the axioms behind the code itself.

    Santa is simply saying that an example of how the code works is self explanatory in giving them the concepts necessary.

    Santa, learning by example is one method of teaching, but you didn't learn by example. you posted a solution, with no explanation of how you decided that this solution was the correct one. It IS the output of your thought process, and it isn't the output that is important. It's important that the OP goes on that same thought process, so the concepts that you have obviously already developed can be developed within their minds as well. All the same, the OP was happy with that and in this particular case it might have worked out for the best (I still believe on the contrary, but if OP's happy then what the hell). That still isn't to say that it will work out for the best in all cases. From a statistical, logical and educational point of view, it still makes the most sense to explain the problem, then attempt to get OP to go through it themselves.

    All the same santa, the point of this post was so you see that we get your argument, and you were only trying to help. There are just certain rules that this forum adheres too, in order to make the most educationally beneficial environment!
    I'm done discussing about it by now. If there are rules for helping then point me to them in the rules section?

  7. #47
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: Incorrect formulas

    Not all rules are written down.
    Most posters, when it is pointed out that we generally frown upon posting coded up answers, accept it and move on...

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Help with average amount formulas
    By dimesnnix in forum New To Java
    Replies: 6
    Last Post: 06-03-2011, 01:45 AM
  2. Replies: 0
    Last Post: 12-06-2010, 03:36 PM
  3. Formulas in methods or constructors?
    By kyameron in forum New To Java
    Replies: 11
    Last Post: 11-20-2010, 12:22 PM
  4. What in my function incorrect?
    By artemff in forum New To Java
    Replies: 5
    Last Post: 01-02-2010, 04:25 PM
  5. Incorrect Package? Help!
    By chaits86 in forum NetBeans
    Replies: 10
    Last Post: 12-17-2008, 03:08 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
  •