//Начало кода
let object = {
about: {
name: "Кафе",
adress: "Улица Молокова, дом 3."
},
doxod: {
prod: 68,
thank: 12,
investors: 6,
alln: 0,
},
rabotn: {
rabot: 4,
},
rasxod: {
zp: 23,
other: 40,
allr: 0,
}
}
// переменные
let doxod = object.doxod
let rasxod = object.rasxod
let about = object.about
let rabotnk = object.rabotn
let all1 = 0
let newall1 = 0
let newall2 = 0
// функции
function doxods(doxod,newall1) {
newall1 = doxod.alln + doxod.prod + doxod.thank + doxod.investors
alert(newall1)
return newall1
}
function rasxods(rasxod,newall2) {
newall2 = rasxod.allr + rasxod.zp + rasxod.other
alert(newall2)
return newall2
}
function all(all1,newall1,newall2) {
all1 = newall1 + newall2
alert(all1)
return all1
}
function abouts(about,rabotnk,all1) {
alert("Название кафе: " + about.name)
alert("Адресс: " + about.adress)
alert("Количество работников: " + rabotnk.rabot)
alert("Чистый доход кафе: " + all1)
}
// вызов
newall1 = doxods(doxod,newall1)
newall2 = rasxods(rasxod,newall2)
all1 = all(all1,newall1,newall2)
abouts(about,rabotnk,all1)