0
Convert currency
function convert(amount,rate){ return amount*rate; } console.log(convert(42,0.72)); console.log(convert(1050,9.4)); //convert(42,0.72); //convert(1050,9.4); No matter what I do I can’t pass this project What I’m missing , can you help please
2 Réponses
+ 1
Saif Aljubori , don't call your convert function with specific values, because they're read as input. Why do you remove the main function where input variables are read to test your code. According to your code it can be changed to :
function main() {
var amount = parseFloat(readLine(), 10);
var rate = parseFloat(readLine(), 10);
console.log(convert(amount, rate));
}
function convert(amount,rate){
return amount*rate;
}
0
thanks a lot