PetShop и Yard Greening
Защо в Visual Studio работи, а в judge не го приема?
PetShop:
function solve() {
function PetShop(numberDogs, numberCat) {
let priceDogFood=2.50;
let priceCatFood=4.00;
let totalprice=(numberDogs*priceDogFood) + (numberCat*priceCatFood);
console.log(totalprice.toFixed(2)+"lv");
}}
Yard Greening:
function solve() {
function yard(squaremet) {
let discount=0.18;
let priceyard=7.61;
let prise=(squaremet*priceyard).toFixed(2);
let finaldiscount=(prise*discount).toFixed(2);
let finalprise=(prise-finaldiscount).toFixed(2);
console.log('The final prise is: '+finalprise +' lv.');
console.log('The discount is: '+finaldiscount +' lv.');
}}
Благодаря за отговора, но при мен не се получава. Задачата за Yard Greening я прие на 50%.
function yard(squaremet) {
let discount = 0.18;
let priceyard = 7.61;
let price = (squaremet * priceyard).toFixed(2);
let finaldiscount = (price * discount).toFixed(2);
let finalprice = (price - finaldiscount).toFixed(2);
console.log('The final price is: ' + finalprice + ' lv.');
console.log('The discount is: ' + finaldiscount + ' lv.');
}
PetShop-a пробвах всичко, но без успех.