Tennis Equipment от изпит Programming Basics Online Exam - 9 and 10 March 2019
Здравейте, в задача 01.Tennis Equipment от изпит Programming Basics Online Exam - 9 and 10 March 2019 не успявам да се оправя със закръгленията. Пробвах какво ли не, дава ми 70/100.
function tennisEquipment(input) {
let priceOfTennisRacket = Number(input[0]);
let numberOfTennisRackets = Number(input[1]);
let numberOfPairsOfSneakers = Number(input[2]);
let allTennisRacketPrice = priceOfTennisRacket * numberOfTennisRackets;
let allSneakersPrice = ((priceOfTennisRacket * numberOfPairsOfSneakers) / 6);
let price = (allTennisRacketPrice + allSneakersPrice) * 1.2;
let djokovichPrice = Math.round(price) / 8.0;
let sponsorsPrice = Math.round(price) * 7.0 / 8.0;
console.log(`Price to be paid by Djokovic ${Math.floor(djokovichPrice)}`);
console.log(`Price to be paid by sponsors ${Math.ceil(sponsorsPrice)}`);
}