Aj Prieto wrote:First off, read this WhatNotHow.
Next, I'm curious, why not just use doubles?
That way, you don't have to deal with multiple numbers. All you'd do is manipulate one value rather than two.
Pseudo code solution (main method of application class):
Prompt user for input values
Read input values
Create MonetaryValue object for the balance of the account
Set the value of the object with the start dollar and cents values ..........................setValue()
Create MonetaryValue object for the amount to deposit each month
Set the value of the object with the dollar and cents values for monthly deposit .....setValue()
Repeat for correct number of years
Repeat for the correct number of months
Add interest to the balance ..............................................................................addInterest()
Add the monthly deposit amount to the deposit ..................................................add()
Display the new balance