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)); }

3rd Oct 2021, 10:26 AM
Daniel Piray
Daniel Piray - avatar
2 Answers
+ 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)); }
3rd Oct 2021, 10:49 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 3
And your question is ❓
3rd Oct 2021, 10:44 AM
Simba
Simba - avatar