-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
32 lines (24 loc) · 912 Bytes
/
scripts.js
File metadata and controls
32 lines (24 loc) · 912 Bytes
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
let money = prompt('Ваш бюджет на месяц?'),
time = prompt('Введите дату в формате YYYY-MM-DD');
let appData = {
budget: money,
timeData: time,
expenses: {},
optionalExpenses: {},
income: [],
saving: false
};
for (let i = 0; i < 2; i++) {
let s = prompt('Введите ' + i +
' обязательную статью расходов в этом месяце'),
m = prompt('Во сколько обойдется?');
if ( (typeof(s)) === 'string' && (typeof(s)) != null && typeof(m) != null &&
typeof(m) === 'string' && s != '' && m != '') {
appData.expenses.s = m;
} else {
alert('Введите правильные данные');
i--;
}
};
appData.moneyForDay = appData.budget/30;
alert("Ежеднвный расход: " + appData.moneyForDay + " уев");