-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex2.js
More file actions
72 lines (54 loc) · 1.54 KB
/
Copy pathindex2.js
File metadata and controls
72 lines (54 loc) · 1.54 KB
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
59
60
61
62
63
Create a variable myDecimal and give it a decimal value with a fractional part (e.g. 5.7).
var ourDecimal = 5.7;
// Only change code below this line
var myDecimal = 5.7;
Change the 0.0 so that product will equal 5.0.
var product = 2.0 * 2.5;
Change the 0.0 so that quotient will equal to 2.2.
var quotient = 4.4 / 2.0;
Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.
// Only change code below this line
var remainder = 11%3;
Convert the assignments for a, b, and c to use the += operator.
var a = 3;
var b = 17;
var c = 12;
// Only modify code below this line
a += 12;
b += 9;
c += 7;
Convert the assignments for a, b, and c to use the -= operator.
var a = 11;
var b = 9;
var c = 3;
// Only modify code below this line
a -= 6;
b -= 15;
c -= 1;
Convert the assignments for a, b, and c to use the *= operator.
var a = 5;
var b = 12;
var c = 4.6;
// Only modify code below this line
a *=5;
b *=3;
c *=10;
Convert the assignments for a, b, and c to use the /= operator.
var a = 48;
var b = 108;
var c = 33;
// Only modify code below this line
a /= 12;
b /= 4;
c /= 11;
You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and
apply the algorithm to assign it the corresponding temperature in Fahrenheit.
function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
fahrenheit = celsius * (9/5) + 32
// Only change code above this line
return fahrenheit;
}
// Change the inputs below to test your code
convertToF(30);