List of Exercises # 2
1) Create a function to convert Celsius to Fahrenheit. Use it to convert the temperatures below:
The formula for the conversion is: F = (9 * C / 5) + 32
2) The array below is the classification of students in a contest. It is ordered from lowest to highest grades.
var classification = [ "John Hill" , "Mary Jane", "Gary Vee", "Paricia Mills", "Helen Hall", "Paul Green" ];
3) Consider the object below:
var course = {
'title': "Learn to Code in Python 3",
'categories': ['programming', 'technology', 'python'],
'5_stars_reviews': 420,
'4_stars_reviews': 80,
'3_stars_reviews': 33,
'2_stars_reviews': 20,
'1_stars_reviews': 4
}
a) Show the course title in the box below:
Course title:b) The main category is the first element of the categories array. Show it in the box below:
Main Category:c) Create a method to calculate the percentage of 5 stars reviews rounded with no decimal places and show the result below:
Percentage of 5 stars reviews:4) See the shopping list below:
var shoppingList = ["Milk", "Butter", "Juice", "Bread", "Beer", "Rice", "Potatoes", "Chocolate"];
Do the following changes to the list:
- Get the last item and place it at the beginning of the list.
- Add two more items at the end of the list: Cheese and Eggs
Show the updated list in the console.