Chapter project
Miles-to-kilometers converter
Create a variable that contains a value in miles, convert it to kilometers, and log the value in kilometers in the following format:
The distance of 130 kms is equal to 209.2142 miles
For reference, 1 mile equals 1.60934 kilometers.
BMI calculator
Set values for height in inches and weight in pounds, then convert the values to centimeters and kilos, outputting the results to the console:
- 1 inch is equal to 2.54 cm
- 2.2046 pounds is equal to 1 kilo
Output the results. Then, calculate and log the BMI: this is equal to weight (in kilos) divided by squared height (in meters). Output the results to the console.