Any examples please?☹ | Sololearn: Learn to code for FREE!

0

Any examples please?☹

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

4/9/2021 4:00:52 PM

Ana Hoxha

9 Answers

New Answer

+4

Multiply both parameters

0

First try then ask.

0

function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount, rate)); }

0

Ana Hoxha Explanation is already given. Read again and solve problem. Don't ask for direct solution.

0

Idk how to do the code im trying☹

0

Ana Hoxha Then first learn coding. This is just a simple program. In explanation already given you have to create a function to make code work.

0

Ok ok i will try again😁

0

function main(){ var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount,rate)) } function convert (amount,rate ){ return (amount*rate); } IS THIS OK?

0

Ana Hoxha Well done. Did you get output?