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: NEED HELP GETTING MY ANNUITY PRORAM TO WORK!!! Quartley payment is $500 profit is... 6,255.12

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default NEED HELP GETTING MY ANNUITY PRORAM TO WORK!!! Quartley payment is $500 profit is... 6,255.12

    HERE IS MY CODE

    double p; //amount of payment
    double r;//APR is between 1.000% 10.000%
    double apr;
    double y;
    double n; //number of periods
    double v; //annuity value
    double profit;



    //Get quarterly payment
    System.out.println("\t\t\tEnter Quarterly Payment Amount:");
    Scanner keyboard = new Scanner(System.in);
    p = keyboard.nextFloat();

    //Get APR
    System.out.println("Enter APR:");
    apr = keyboard.nextFloat();
    r = (apr * .01); //Multiply by hundreths


    //Get Contract Length
    System.out.println("Enter Contract length.");
    y = keyboard.nextFloat();
    n = y * 4;


    //ECHO
    System.out.println("Quarterly Payment:" + p);
    System.out.println("APR:" + r);
    System.out.println("Contract Length: " + y);

    v = p * (Math.pow ( 1 + r , n ) - 1 ) / r ;

    System.out.println("Annuity Value:



    annuity should be 26,255.12 with an investment of $20,000 profit is $6,255


  2. #2
    Member Kewish's Avatar
    Join Date
    Apr 2013
    Location
    Australia
    Posts
    116
    Thanks
    10
    Thanked 17 Times in 14 Posts

    Default Re: NEED HELP GETTING MY ANNUITY PRORAM TO WORK!!! Quartley payment is $500 profit is... 6,255.12

    Quote Originally Posted by bush.bryant View Post
    annuity should be 26,255.12 with an investment of $20,000 profit is $6,255
    1. What is your question (What is it doing, not doing, provide your test data to get the above).
    2. Paste your code in formatting tags
    3. Make sure your program compiles
    4. When taking user input, you don't need to use println. print by itself will suffice and allow you to take the input from the same line.
    5. Why all the hardcoded tabs in the first print statement?

Similar Threads

  1. Help with Stock Profit Program
    By pherigo in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 30th, 2013, 09:55 AM
  2. Mobile Applications Developer £40k + profit share - North Lancashire
    By john_sedgewick in forum Paid Java Projects
    Replies: 0
    Last Post: February 28th, 2013, 08:24 AM