Retirement Planner

Line: Input Line
Easy Difficulty Input Learning Outcome One Walkthrough
Type: Walkthrough
You should have completed: Getting Numbers This topic leads to: Youth Calculator

Summary

Now it is time to perform some basic calculations with the input the user gives us. The program will ask the user for their age and calculate how long it will be before they are 65.

If the user enters something that is not a number, the program will crash, there are ways to avoid this which will be covered later.

Task

  1. Create a new console application
  2. Type in the following code and resolve any compilation errors
  3. Run the program and try it with a few different ages.

Questions

  1. Now, how would you modify the program to accept an age as a fractional value, say 13.75? Hint:You may need to change several parts.