//sample solution
function calculateTotalCosts(salary, numWorkers, city){
var fixedCosts = 5000;
var variableCosts = salary * numWorkers;
if(city == "NYC"){
return fixedCosts + variableCosts + 30000;
} else {
return fixedCosts + variableCosts;
}
}
calculateTotalCosts(25000, 5, "NYC");
function calculateTotalCosts(salary, numWorkers, city){
var fixedCosts = 5000;
var variableCosts = salary * numWorkers;
if(city == "NYC"){
return fixedCosts + variableCosts + 30000;
} else {
return fixedCosts + variableCosts;
}
}
calculateTotalCosts(25000, 5, "NYC");
No comments:
Post a Comment