0
Can you help me solve this problem? I would so much appreciate it, Thank you in advance.
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
2 Respostas
+ 2
//arrow function
const currencyExchange=(amount,rate)=>amount*rate
//calling the function
const result = currencyExchange(100,1.1)
console.log(result)
0
Thank you very much Yasin Rahnaward for taking out the time to respond to this I'm really grateful, Having said that the code still doesn't work.
The solution panel/code Playground to the question has a code like this:
function main() {
var amount = parseFloat(readLine(), 10);
var rate = parseFloat(readLine(), 10);
console.log(convert(amount, rate));
}