Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Топ 10 використання JavaScript:</h1>
<li>Мобільні додатки</li>
<li>Літаючі роботи</li>
</ol>
<script src="./script/index.js"> </script>
<script src="./script/js_2/inlex.js"> </script>
</body>

</html>
45 changes: 45 additions & 0 deletions script/js_2/inlex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//1.1
const d = 0.1 + 0.2;
console.log(+d.toFixed(2));

//1.2
let num_one = '1';
let num_two = 5;
console.log(+num_one + num_two);

//1.3
let flashMemory = prompt('Какой объём памяти у флешки?');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+prompt()

const file = 820;
let amount = flashMemory * 1000 / file;
console.log(Math.floor(amount));

//2.1
let chockolate = prompt('Сколько стоит плитка шоколада?');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+prompt()

let money = prompt('Сколько у тебя денег?');
let buy = +money / +chockolate;
console.log('Ты сможешь купить', Math.floor(buy), 'плиток шоколада');
console.log('У тебя еще останеться', +money % +chockolate, '$');

//2.2
let number = prompt('Введите трехзначное число');
let number_one = Math.floor(number / 100);
let number_two = parseInt((+number / 10) % 10);
let number_three = +number % 10;
console.log(`${number_three}${number_two}${number_one}`);

// 3.1
let vklad = prompt('Какую сумму вы хотите положить на депозит?');
const interest = 5;
const year = 365;
const day_twomonth = 121;
console.log('Вы получити за два месяца', ((vklad * interest * (day_twomonth / year)) / 100).toFixed(2));

// 3.2
// 2 && 0 && 3 - віведит 0

// 2 || 0 || 3 - віведит 2

// 2 && 0 || 3 - віведит 3