AssignmentsWeek 01 · FoundationsFrom goal to program — graduation age
wk01.p10Practice exerciseWeek 01 · FoundationsOpen · due in week 1

From goal to program — graduation age

We give you the goal. You break it into steps and build the program yourself. No requirements list. No starter code. The exercise is the planning, not the typing.

What you'll build

We give you the goal. You break it into steps and build the program yourself. No requirements list. No starter code. The exercise is the planning, not the typing.

Requirements

The must-do parts. If any are missing, we'll ask you to take another pass.

  1. The goal — build a program that tells the user how old they will be when they complete their degree.
  2. Decide for yourself what questions the program needs to ask, and in what order, to figure out the answer.
  3. The output is one clear sentence that includes the user's name, the age they will be when they finish, and the year they finish.
  4. Wherever the user types a number, your program treats it as a number for the math.
  5. The result is correct for any reasonable set of inputs, not just the example shown below.
Bonus, if you're feeling brave
  • Before you write any code, plan your steps on paper or in a markdown cell. Attach a photo of the plan, or paste the plan as text, with your submission.
  • Handle the edge case where the user is starting this year — the line about 'years until you begin' should read sensibly when that gap is zero.

Examples

What your program should look like when it runs. Lines starting with $ are typed by you; the rest is your program.

Example cell run
Your name: Amara
Birth year: 1999
Target start year: 2027
Program length in years: 2

Amara, you will be 30 years old when you complete your degree in 2029.

How we'll grade it

Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.

CheckWhat we look forPt
It runsStarts cleanly. Asks every question it needs and prints a result without crashing.1
Achieves the goalProduces the right shape of output for the example below — a single sentence naming the user, the finishing age, and the finishing year.1
Math is rightWorks correctly on a second set of inputs the grader will try, not just the example shown.1
Reads wellThe output is a clean human sentence, not labelled debug lines.1
Ready?
Hand it in
You can submit a draft and revise later if you're not done.
Begin submission →