logo javascript

Javascript Course for Beginners

Instructor: Ivan Lourenço Gomes

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

38
oC =
show the result here
oF
24
oC =
show the result here
oF
-1
oC =
show the result here
oF

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" ]; 
                
            
show the names of the three best students here

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:
show the course title here

b) The main category is the first element of the categories array. Show it in the box below:

Main Category:
show the main category here

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:
Show the percentage here (example: 78%)

4) See the shopping list below:

                

    var shoppingList = ["Milk", "Butter", "Juice", "Bread", "Beer", "Rice", "Potatoes", "Chocolate"]; 

                
            

Do the following changes to the list:

Show the updated list in the console.


Contents