0
help me about this code
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: 110Converting 100 at the rate of 1.1 is equal to 100*1.1 = 110. function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount, rate)); }
2 Respuestas
+ 2
function main() {
var amount = parseFloat(readLine(), 10);
var rate = parseFloat(readLine(), 10);
console.log(convert(amount, rate));
}
Then create a function called convert that takes two parameters that are amount and rate.
function convert(amount,rate){
let cvt = amount * rate;
//At last return amount * rate
return cvt;
}
this may help
+ 1
Turg'unboyev Davlat
Review lesson 26.1 of your Javascript tutorial.
The answer is there!