Skip to content

Commit 1c8b736

Browse files
committed
Start translation and save [en] version
1 parent c8a8b60 commit 1c8b736

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

Exercises.en.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Exercises
2+
3+
## Identifiers
4+
5+
1. Define variable to store your name as a string.
6+
2. Define constant to store your birth year as a number.
7+
3. Prepare function to print greeting with single argument.
8+
4. Call function passing value as literal.
9+
5. Call function passing variable.
10+
6. Call function passing constant.
11+
12+
## Loop
13+
14+
1. Print all odd numbers from the range [15, 30] including endpoints.
15+
2. Implement function `range(start: number, end: number)` doing the same task.
16+
17+
## Function
18+
19+
1. Implement function `average` with signature
20+
`average(a: number, b: number): number` calculating average (arithmetic mean).
21+
2. Implement function `square` with signature
22+
`square(x: number): number` calculating square of x.
23+
3. Implement function `cube` with signature
24+
`cube(x: number): number` calculating cube of x.
25+
4. Call functions `square` and `cube` in loop, then pass their results to
26+
function `average`. Print what `average` returns.
27+
28+
## Object
29+
30+
1. Define constant object with single field `name`.
31+
2. Define variable object with single field `name`.
32+
3. Try to change field `name` and assign other object to both identifiers.
33+
Explain script behaviour.
34+
4. Implement function `createUser` with signature
35+
`createUser(name: string, city: string): object`. Example:
36+
`createUser('Marcus Aurelius', 'Roma')` will return object
37+
`{ name: 'Marcus Aurelius', city: 'Roma' }`
38+
39+
## Array
40+
41+
1. Define array of objects with two fields: `name` and `phone` (phone book).
42+
Example: `{ name: 'Marcus Aurelius', phone: '+380445554433' }`.
43+
2. Implement function `findPhoneByName` with signature
44+
`findPhoneByName(name: string): string`. Returning phone from that object
45+
where field `name` equals argument `name`. Use `for` loop for this search.
46+
47+
## Hash
48+
49+
1. Define hash with `key` contains `name` (from previous example) and `value`
50+
contains `phone`.
51+
2. Implement function `findPhoneByName` with signature
52+
`findPhoneByName(name: string): string`. Returning phone from hash/object.
53+
Use `hash[key]` to find needed phone.

Exercises.ru.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Exercises
1+
# Упражнения
22

3-
## Identifiers
3+
## Идентификаторы
44

55
1. Define variable to store your name as a string.
66
2. Define constant to store your birth year as a number.
@@ -9,12 +9,12 @@
99
5. Call function passing variable.
1010
6. Call function passing constant.
1111

12-
## Loop
12+
## Циклы
1313

1414
1. Print all odd numbers from the range [15, 30] including endpoints.
1515
2. Implement function `range(start: number, end: number)` doing the same task.
1616

17-
## Function
17+
## Функции
1818

1919
1. Implement function `average` with signature
2020
`average(a: number, b: number): number` calculating average (arithmetic mean).
@@ -25,7 +25,7 @@
2525
4. Call functions `square` and `cube` in loop, then pass their results to
2626
function `average`. Print what `average` returns.
2727

28-
## Object
28+
## Объекты
2929

3030
1. Define constant object with single field `name`.
3131
2. Define variable object with single field `name`.
@@ -36,15 +36,15 @@ Explain script behaviour.
3636
`createUser('Marcus Aurelius', 'Roma')` will return object
3737
`{ name: 'Marcus Aurelius', city: 'Roma' }`
3838

39-
## Array
39+
## Массивы
4040

4141
1. Define array of objects with two fields: `name` and `phone` (phone book).
4242
Example: `{ name: 'Marcus Aurelius', phone: '+380445554433' }`.
4343
2. Implement function `findPhoneByName` with signature
4444
`findPhoneByName(name: string): string`. Returning phone from that object
4545
where field `name` equals argument `name`. Use `for` loop for this search.
4646

47-
## Hash
47+
## Коллекции: хеш-таблицы
4848

4949
1. Define hash with `key` contains `name` (from previous example) and `value`
5050
contains `phone`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy