-
Notifications
You must be signed in to change notification settings - Fork 10
/
exercises.js
59 lines (19 loc) · 2.04 KB
/
exercises.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*A function is a series of instructions that instructs the computer to perform a certain task. Functions allow you to reuse your code.
Invoke your functions and console.log your results*/
/*1. Create a function named 'makeRamen' which takes one string parameter: protein. This function will return the following statement:
'____ tonkotsu ramen.' Where the blank space will be populated be populated based on the parameter.*/
//2. Create a function named 'fullName' which takes two string parameters: firstName, lastName. This function will concatenate the first and last name.
//3. Create a function named 'add' which takes two number parameters: num1, num2. This function will sum up two numbers.
//4. Create a function named 'findAge' which takes two number parameters: current, birth. This function will subtract the birth year from the current year.
/*5. Create a function named 'selfIntro' which takes two string and two number parameters : first, last, current, birth).
This function will return the following statement:
'Hello, my name is _____ and I am ____ years old.' Where the blank spaces will be populated based on the parameters.
Please make use of the fullName and findAge functions for this question.*/
//6. Create a function named 'ozToCup' which takes one number parameter oz. This function will convert fluid ounce to cup.
/*7. Create a function named 'yenConverter which takes one number parameter dollar. This function will convert dollar to yen.
Please use today's dollar to yen exchange rate.*/
//8. Create a function named 'tempConverter' which takes one number parameter c. This function will convert celsius to fahrenheit.
//9. Create a functin named 'throwBack' which takes one array parameter arr. This function will reverse the order of the elements in an array.
/*10. Create a function named 'unite' which takes one array parameter arr.
This function will reverse the order of the elements in an array and then join all the elements into a string.
Please make use of the throwBack function for this question*/