- 1
HELP WRITE CURRENCY CONVERTER
HELP 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 function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); var convert = rate * amount; console.log(convert(amount, rate)); }
4 Réponses
0
function convert(amount, rate) {
return amount * rate;
}
+ 2
https://www.sololearn.com/Discuss/2710591/?ref=app
you must define a function 'convert', not a variable... or at least just output 'convert' variable value ;)
+ 2
Tomás Corrales Lemoine what are you trying to do? you just got a best answer mark for the same question/OP, while you just spoil the problem, as he should implement at least the basics to start learning ^^
+ 1
function convert(amount){
return amount * rate;
}