0
Currency converter Solution
function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); function convert(){ var result = amount * rate; return result } console.log(convert(amount, rate)); }
2 ответов
+ 1
Daniel Piray , your convert function doesn't accept arguments...
But it should...
Here is a solution:
function main() {
var amount = parseFloat(readLine(), 10);
var rate = parseFloat(readLine(), 10);
function convert(a, r){
var result = a * r;
return result
}
console.log(convert(amount, rate));
}
+ 3
And your question is ❓