0

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); console.log(convert(amount, rate)); }

1st Mar 2021, 1:58 AM
Кандыбаев Алишер
Кандыбаев Алишер - avatar
5 Antworten
0
function convert(amount, rate) { return amount * rate; }
1st Mar 2021, 2:31 AM
Tomás CL 🇨🇺 (temporarily inactive)
Tomás CL 🇨🇺 (temporarily inactive) - avatar
+ 1
Кандыбаев Алишер please describe your question :)
1st Mar 2021, 1:59 AM
TheCoder
+ 1
you must define a function 'convert', not a variable... or at least just output 'convert' variable value ;)
1st Mar 2021, 2:06 AM
visph
visph - avatar
+ 1
Tomás Corrales Lemoine you didn't help OP by giving the answer: he must apply its learn to acquire skill ;) sometimes we could give corrected code, but sometimes we should just give hints, all the more when the hints are really close to the answer...
1st Mar 2021, 2:35 AM
visph
visph - avatar
0
Ok
1st Mar 2021, 2:04 AM
Кандыбаев Алишер
Кандыбаев Алишер - avatar