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
2 Antworten
+ 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
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));
}