24 - Creating a unit converter using switch (JS lessons)
📘 Task: Unit Converter
Create an application "Unit Converter".
The user enters a number and selects the type of conversion.
After clicking the button, you need to:
- Perform the conversion using the formula
- Display the result
📐 Use the following formulas:
- Kilometers → miles
miles = value × 0.621371
- Kilograms → pounds
pounds = value × 2.20462
- Celsius → Fahrenheit
fahrenheit = (value × 9 / 5) + 32
🧪 Examples:
- 12 km = 7.46 miles
- 12 kg = 26.46 pounds
- 12°C = 53.60°F
📌 Important:
The formulas are duplicated in the source code (in JavaScript) as comments.
Do not modify the HTML.