New Posts  All Forums:Forum Nav:

Java Homework help~!

post #1 of 4
Thread Starter 
Hey all,

Basically I'm at a loss with a particular question in my latest Java assignment. Here's the culprit:
Quote:
An annuity (sometimes called a reverse mortgage) is an account that yields a fixed payment every year until it is depleted.
The present value of the annuity is the amount that you would need to invest at a given interest rate so that the payments can be made.

The present value of an annuity (PVann) at the time of the first deposit can be calculated using the following formula:

PVann = PMT ยท ({[(1 + i)n - 1 - 1] / i } / (1 + i)n - 1 + 1)

where:
PMT: periodic payment
i: periodic interest or compound rate
n: number of payments

What is the present value of an annuity that will pay out $10,000 in each of the next 20 years if the interest rate is 8 percent?
Write a program to calculate the present value of an annuity for these values. Remember that you can use Math.pow(x, y) to calculate xy.

What is your program?

I don't know where to start with the code whatsoever, so any pointers in the right direction, or helping me break down what needs to be done would be great. Thanks~
post #2 of 4
It looks like your just taking that equation and using it on a given input and just showing the output, fairly basic. Are you super new to programming?
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
post #3 of 4
the question asks you to output the PV and gives you the equation so just make a function with the parameters that you need and return a double.

then just answer the questions.
Your Mom
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i5-750 @ 4Ghz Gigabyte P55A-UD4P MSI GTX 460 HAWK 850/2000 SLI Patriot ViperII Sector5 1600MHz CL8 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 500GB LG 24x Windows 7 Ultimate x64 Samsung SyncMaster P2270 
KeyboardPowerCaseMouse
Steelseries 6Gv2 Corsair TX750 Thermaltake V9 Black Edition Razer Deathadder 
Mouse Pad
Steelseries QcK 
  hide details  
Reply
Your Mom
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i5-750 @ 4Ghz Gigabyte P55A-UD4P MSI GTX 460 HAWK 850/2000 SLI Patriot ViperII Sector5 1600MHz CL8 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 500GB LG 24x Windows 7 Ultimate x64 Samsung SyncMaster P2270 
KeyboardPowerCaseMouse
Steelseries 6Gv2 Corsair TX750 Thermaltake V9 Black Edition Razer Deathadder 
Mouse Pad
Steelseries QcK 
  hide details  
Reply
post #4 of 4
If you don't know how to use functions yet, just declare all the pronumerals in the formula as variables then use the Scanner or BufferedReader to read in whatever values you want, plug them into the formula and System.out.println(); the answer...

This is an easy question, not gonna post an answer as you said it's for homework.
    
CPUMotherboardGraphicsGraphics
Intel Core i7 860 Asus P7P55D-E Pro MSI GTX560 Ti TwinFrozr II SLI MSI GTX560 Ti TwinFrozr II SLI 
RAMHard DriveHard DriveHard Drive
Corsair 8GB DDR3 1600MHz CL9 XMS3 (2 x 4GB) OCZ Vertex 3 SSD Western Digital Caviar Black 1TB 7200RPM 64MB C... Western Digital Caviar Green 1TB ~5900RPM 64MB ... 
Optical DriveCoolingOSMonitor
Lite-On 24x DVD-RW CoolerMaster V8 Windows 7 Professional SP1 3 x Samsung S22B350H 
KeyboardPowerCaseMouse
Ducky Shine II Corsair HX850 CoolerMaster Storm Enforcer Logitech M500 
Mouse PadAudio
Razer Goliathus Microsoft LifeChat LX 3000 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
Intel Core i7 860 Asus P7P55D-E Pro MSI GTX560 Ti TwinFrozr II SLI MSI GTX560 Ti TwinFrozr II SLI 
RAMHard DriveHard DriveHard Drive
Corsair 8GB DDR3 1600MHz CL9 XMS3 (2 x 4GB) OCZ Vertex 3 SSD Western Digital Caviar Black 1TB 7200RPM 64MB C... Western Digital Caviar Green 1TB ~5900RPM 64MB ... 
Optical DriveCoolingOSMonitor
Lite-On 24x DVD-RW CoolerMaster V8 Windows 7 Professional SP1 3 x Samsung S22B350H 
KeyboardPowerCaseMouse
Ducky Shine II Corsair HX850 CoolerMaster Storm Enforcer Logitech M500 
Mouse PadAudio
Razer Goliathus Microsoft LifeChat LX 3000 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming