Repository navigation
Expand file tree
/
Copy pathlesson-2.js
More file actions
68 lines (51 loc) · 1.77 KB
/
Copy pathlesson-2.js
File metadata and controls
68 lines (51 loc) · 1.77 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
64
65
66
67
68
// 2-й урок
// 10.1 Арифметические операторы и выражения
// Арифметические выражения состоят из операторов и операндов
// операторы это (+ - * / % ** ++ --)
// let x = 10;
// let y = 3;
// console.log('x + y =', x + y);
// console.log('x - y =', x - y);
// console.log('x * y =', x * y);
// console.log('x / y =', x / y);
// console.log('x ** y =', x ** y);// степень
// console.log('x % y =', x % y); // modulus
// console.log(x++); // x = x + 1 // increment
// console.log(++x); // x = x + 1, will increment the value in the variable, not after.
// console.log(x--); // x = x - 1 // decrement
// console.log(--x); // x = x - 1 will decrement the value in the variable, not after.
// console.log(x);
// let students = 20;
// students = students + 1; // 21
// students = students - 1; // 20
// students = students / 2; // 10
// students = students * 2; // 20
// students = students ** 2; // 400
// students = students % 3; // 1
// students += 1;
// students -= 1;
// students /= 2;
// students *= 2;
// students **= 2;
// students %= 3;
// console.log(students);
// students++; // students += 1;
// students--; // students -= 1;
// // students = students + 3;
// console.log(++students);
// console.log(students);
// Задача 1
// Чему равен 840с в минутах?
// let a = 840;
// let b = 60;
// let result = a / b;
// console.log('840s in min: ', result);
// Задача 5
// let x = 21000; // в секундах
// let y = 3600; // 1hr = 60min*60s = 3600
// // let inHours = x / y;
// let inHours = Math.floor(x/y);
// let mod = x % y;
// let inMins = mod / 60;
// console.log('hours:', inHours, 'mins:', inMins);
// console.log(inHours, 'hours', inMins, 'mins');