Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Ill keep asking till i get an answer

  1. #1
    Member
    Join Date
    Mar 2013
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ill keep asking till i get an answer

    I cant figure out this damn line of code please help me!!!!!!

    In which PMT is the monthly payment, P is the listed price of the house, D is the
    down payment, r is the annual interest rate and m is the number of payments.

    pmt = ((p-d)*r/12) / (1-(1+(r/12)^-m)

    this is my code
     
     
     
     
     
     
     
     
    import java.util.Scanner;
     
    	public class Project1 {
    	public static void main(String[] args) {
    		Scanner input = new Scanner(System.in);
     
    		System.out.println("Enter the price of the house: ");
    		double housePrice = input.nextDouble();
    		System.out.println("Enter the down payment: ");
    		double downPayment = input.nextDouble();
    		System.out.println("Enter the annual interest rate: ");
    		double annualInterestRate = input.nextDouble();
    		System.out.println("Enter the number of payments: ");
    		double numberofPayments = input.nextDouble();
     
    		double monthlyPayment= ( ((housePrice - downPayment) * (annualInterestRate/12)) /((1-(1+(annualInterestRate/12)))));//<---this is where im stuck how do i enter the  negative m      into this equation where do i put the math.pow. Please for the love of god throw me a bone ive been stuck on this for two hours now




    }


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Ill keep asking till i get an answer

    Quote Originally Posted by iamgonge View Post
    I cant figure out this damn line of code please help me!!!!!!

    In which PMT is the monthly payment, P is the listed price of the house, D is the
    down payment, r is the annual interest rate and m is the number of payments.

    pmt = ((p-d)*r/12) / (1-(1+(r/12)^-m)

    this is my code
     
     
     
     
     
     
     
     
    import java.util.Scanner;
     
    	public class Project1 {
    	public static void main(String[] args) {
    		Scanner input = new Scanner(System.in);
     
    		System.out.println("Enter the price of the house: ");
    		double housePrice = input.nextDouble();
    		System.out.println("Enter the down payment: ");
    		double downPayment = input.nextDouble();
    		System.out.println("Enter the annual interest rate: ");
    		double annualInterestRate = input.nextDouble();
    		System.out.println("Enter the number of payments: ");
    		double numberofPayments = input.nextDouble();
     
    		double monthlyPayment= ( ((housePrice - downPayment) * (annualInterestRate/12)) /((1-(1+(annualInterestRate/12)))));//<---this is where im stuck how do i enter the  negative m      into this equation where do i put the math.pow. Please for the love of god throw me a bone ive been stuck on this for two hours now




    }
    Please don't post the same question more than once. This needless splitting of the discussion is not fair to the volunteers who work this forum and is against forum rules which you agreed to on joining. Keep this up and we'll have no choice but to ban you. You've received one warning.

    Locking this thread as a duplicate.

Similar Threads

  1. Replies: 3
    Last Post: March 9th, 2013, 07:22 PM
  2. [SOLVED] please answer this question,tq
    By suganti selvaraj in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 6th, 2013, 12:50 AM
  3. Can somebody help me to answer this? Thanks!
    By dshainad in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 13th, 2012, 09:47 PM
  4. What's ur answer?
    By Tanmaysinha in forum The Cafe
    Replies: 6
    Last Post: October 12th, 2011, 06:26 AM
  5. need answer for these
    By satishbs in forum Java Theory & Questions
    Replies: 2
    Last Post: April 15th, 2011, 01:46 AM