shopping - js basic
не мога да си намеря грешката
function shopping(input) {
let budget = Number(input[0])
let videocards = Number(input[1]) * 250
let procesors = Number(input[2]) * (videocards * 0.35)
let ramMermory = Number(input[3]) * (videocards * 0.1)
let totalPrice = videocards + procesors + ramMermory
if (input[1] > input[2]) {
totalPrice = totalPrice - (totalPrice * 0.15)
} else (input[1] < input[2])
totalPrice = totalPrice
if (budget > totalPrice) {
left = (budget - totalPrice).toFixed(2)
console.log(`You have ${ left } leva left!`)
} else if (budget < totalPrice) {
notenought = (totalPrice - budget).toFixed(2)
console.log(`Not enough money! You need ${ notenought } leva more!`)
}
}