Any examples please?☹ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Any examples please?☹

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

9th Apr 2021, 4:00 PM
Ana Hoxha
Ana Hoxha - avatar
11 Answers
+ 3
Multiply both parameters
9th Apr 2021, 4:02 PM
TOLUENE
TOLUENE - avatar
+ 1
Ana Hoxha Explanation is already given. Read again and solve problem. Don't ask for direct solution.
9th Apr 2021, 4:07 PM
A͢J
A͢J - avatar
+ 1
Ana Hoxha Then first learn coding. This is just a simple program. In explanation already given you have to create a function to make code work.
9th Apr 2021, 4:14 PM
A͢J
A͢J - avatar
+ 1
Ana Hoxha Well done. Did you get output?
9th Apr 2021, 4:22 PM
A͢J
A͢J - avatar
+ 1
monika Narendra Mahajan Sir is not active now
1st Jul 2023, 3:13 PM
A͢J
A͢J - avatar
0
First try then ask.
9th Apr 2021, 4:02 PM
Matias
Matias - avatar
0
function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount, rate)); }
9th Apr 2021, 4:03 PM
Ana Hoxha
Ana Hoxha - avatar
0
Idk how to do the code im trying☹
9th Apr 2021, 4:10 PM
Ana Hoxha
Ana Hoxha - avatar
0
Ok ok i will try again😁
9th Apr 2021, 4:16 PM
Ana Hoxha
Ana Hoxha - avatar
0
function main(){ var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount,rate)) } function convert (amount,rate ){ return (amount*rate); } IS THIS OK?
9th Apr 2021, 4:19 PM
Ana Hoxha
Ana Hoxha - avatar
0
hii sir I have one problem related to python example during practice session on solo learn
1st Jul 2023, 9:01 AM
monika Narendra Mahajan
monika Narendra Mahajan - avatar