Convert currency | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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

11th Jan 2021, 4:47 PM
Saif Aljubori
Saif Aljubori - avatar
2 Respostas
+ 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; }
11th Jan 2021, 5:17 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
0
thanks a lot
11th Jan 2021, 5:29 PM
Saif Aljubori
Saif Aljubori - avatar