the currency converter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

the currency converter

hello guys I've just started learning JS and I don't know what I'm doing wrong in the currency converter test. this is my code can you tell me what's wrong? function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount, rate)); } function covert(amount, rate){ var c = amount * rate; return c; } console.log(c);

18th Jan 2021, 9:26 AM
needless sword58
needless sword58 - avatar
4 Answers
+ 2
Everything ia ok. Just remove last line (console.log...)
18th Jan 2021, 9:38 AM
george
george - avatar
+ 1
Why do you have console.log(c) at the end?
18th Jan 2021, 9:36 AM
Abhay
Abhay - avatar
0
thank you guys found out the prob <3 function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); function convert(amount, rate){ var c = amount*rate; return c; } console.log(convert(amount, rate)); }
18th Jan 2021, 9:41 AM
needless sword58
needless sword58 - avatar
0
U spelled wrong convert
8th Apr 2021, 8:37 AM
Harshita Kumari
Harshita Kumari - avatar