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.