Project brief
Build two small console programs: a BMI calculator and a leap-year checker. Both exercises focus on arithmetic, comparison and conditional branches.
This is a workbook project in the JavaScript track. It has no single prescribed solution: build it in your own file, test it in the browser or Node, and compare your result with the checklist below.
What you will practise
- Console
- Math
- Conditionals
Build it step by step
- Ask for a height in metres and a weight in kilograms, then compute BMI as weight divided by height squared.
- Print the numeric BMI and the matching category (underweight, healthy range, overweight, obese).
- Write a second script that reads a year and reports whether it is a leap year using the divisibility rules.
- Test both programs with normal values, boundary values and invalid input.
Stretch goal
Add one feature that is not in the list above, then write down why you chose it and what you had to change. Keep the feature small enough to finish in one sitting.
Before you move on
- The project runs without errors in a fresh browser tab or Node process.
- Empty, missing and invalid inputs are handled deliberately.
- The code is split into small functions with clear names.
- You can explain every line you wrote.
Topics: Console, Math, Conditionals.