└── Gold IRA Investment Calculation /Gold IRA Investment Calculation: -------------------------------------------------------------------------------- 1 | class GoldIRA: 2 | def __init__(self, price, init_oz, annual_oz, years, increase_pct): 3 | self.price = price 4 | self.oz = init_oz 5 | self.annual_oz = annual_oz 6 | self.years = years 7 | self.increase_pct = increase_pct 8 | 9 | def calc_retirement_value(self): 10 | for _ in range(self.years): 11 | self.price += self.price * self.increase_pct / 100 12 | self.oz += self.annual_oz 13 | return self.oz * self.price 14 | 15 | def display(self): 16 | value = self.calc_retirement_value() 17 | print(f"Gold IRA value at retirement: ${value:,.2f}") 18 | 19 | ira = GoldIRA(1800, 50, 5, 30, 2) 20 | ira.display() 21 | --------------------------------------------------------------------------------