Pls help me solve | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pls help me solve

You are making a currency converter app. Create a function called convert, which takes two parameters: the amount to convert, and the rate, and returns the resulting amount. The code to take the parameters as input and call the function is already present in the Playground. Create the function to make the code work. Sample Input: 100 1.1 Sample Output: 110

29th Sep 2022, 3:23 PM
Ebube Uwadia
Ebube Uwadia - avatar
2 Answers
+ 3
What help exactly do you need? what have you tried so far? * create a function with 2 parameters * multiply the arguments inside of the function and return the result * call the function with the input value as arguments * output the result
29th Sep 2022, 3:45 PM
Lisa
Lisa - avatar
0
function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); function convert(amount, rate) { return amount*rate; } console.log(convert(amount, rate)); }
29th Sep 2022, 4:30 PM
Kayode
Kayode - avatar