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

• September 19th, 2013, 11:39 PM
bush.bryant
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
• September 20th, 2013, 12:08 AM
Kewish
Re: NEED HELP GETTING MY ANNUITY PRORAM TO WORK!!! Quartley payment is \$500 profit is... 6,255.12
Quote:

Originally Posted by bush.bryant
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?