Hello! I'm new to this forum and decided to join for homework help. I have an assignment due tonight where I need to calculate a worker's total earnings before they retire at age 65. There is a syntax error in line 3 (startingSalary . . .) but I'm not sure what it is or how to fix it. Any help is appreciated.
A sample output should look like this
1 2 3 4 5 6 7 8 9 |
name = input ( 'Enter your name:' ) #obtain name currentAge = int ( input ( 'Enter your age:' ) #obtain age initialSalary = float ( input ( 'Enter your starting salary:' )) #obtain starting salary annualRaise = 0.05 #salary increases 5% annually remainingWorkYears = 65 - age #years left to work for age in range (age, 65 ): salary = (initialSalary * annualRaise) + startingSalary age + = 1 print (name, 'will earn about $' , format (salary, ',.2f' , sep = '')) |
Output:Enter name: Helen
Enter age: 25
Enter starting salary: 20000
Helen will earn about $2,415,995.