{{ message }}

Instantly share code, notes, and snippets.

# Knyazik01/00.html

Last active Apr 29, 2019
Laba 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 2

У двійковому коді 6.35 - це нескінченний дріб вигляду 6.34999999999999964473... Тому при округленні до одного знаку після коми ми отримуємо 6.35 => 6.3

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 3

Округлювати до 2 знаку після коми (75 центів = 0,75 долара). Це робиться так

+(a + b).toFixed(2)

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 4

і просто не досягає 10, а просто "проскакує" це значення

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 7

генеруємо випадкове число у межах 0..1 (функція random із бібліотеки Math) і множимо на max

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 8

function randomInteger(min, max) { var rand = Math.round(min + Math.random() * (max - min + 1)); return rand; }

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 10

Метод indexOf шукає збіги з урахуванням реєстра, тому кинемо рядок у нижній реєстр

free xxxxx - true

innocent rabbit - false

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 11

("Вот, что мне хотелось бы сказать на эту тему:", 20) -> "Вот, что мне хоте..."

("Всем привет!", 20) -> "Всем привет!"

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Завдання 12