Apply your organizational skills
In the past few exercises, you have been learning how to organize your problem-solving into chunks. This is useful because:
- it helps you to divide your code into conquerable chunks
- it makes your code more readable
- it helps you develop organizational habits so that you can avoid spaghetti code in the future.
Saving your work
Open your editor and save the empty document as "
- Enter the example code below
- Customize it to match your style
Extend and expand
Why not try more sophisticated formulas?
For example, the volume of a cone requires you to know both the radius and the height.
Or try some other interesting multi-variable calculation, like the Drake equation, or something else interesting.
Entering numbers is good, but sometimes a slider will allow you to input a number easily from within a range.
Make a search for
<input type="range"> to see how to create a range slider.