Lesson 9 Classwork
Let’s practive all what we know about functions
Spec
Build a car speed calculator with following properties:
- Distance and time should be entered by user
- Calculation should happen after user press “Calculate” button
- Get user input with a separate function and return it as an object
- Speed should be calculated in a separate function and return the value
- Result should be presented in the following way:
- Given data: distance = 30, time = 1
- Speed of a car is: 30km/h
- Above structure should be created by a separate fucntion
Tips
- You need 2 input fields and one button
- div element to display resulted structure
- Use function with return statement and parameters
More practice
Build a converted from Celsius to Fahrenheit
Formula: (C * 9/5) + 32
User should be able to imput a value in Celsius.
Bonus
Continue to work with books store example from previous lessons. Create a possibility for a user to add books into the store.
For that you would need some input fields (to enter book name, author, year and price for ex.), button and some functions to work with this data. Use all your knowlage from all lessons.