0

Can someone guide me through this?

Timmy & Sarah think they are in love, but around where they live, they will only know once they pick a flower each. If one of the flowers has an even number of petals and the other has an odd number of petals it means they are in love. Write a function that will take the number of petals of each flower and return true if they are in love and false if they aren't. Eg. inLove(4, 4) -> false inLove(3,11) -> false

11th Jul 2021, 4:31 PM
Blessing Ngozi Michael
6 Respostas
+ 2
Visit the following links given below: https://github.com/dj9aj/Codewars-Kata-Solution https://prosenjs.blogspot.com/2017/04/opposites-attract-code-wars-problem.html?m=1 http://www.puronglong.com/2015/05/14/Mycodewars(3).html https://www.programmersought.com/article/5408695973/ https://hockeychik99.github.io Note: Please show your attempts first before posting any questions here at sololearn. For more information, don't forget to go through the Sololearn Community Guidelines. Hope this helps.
11th Jul 2021, 4:37 PM
‎ ຸ
+ 1
Thank you Arobo,but the code you gave is in java, I need codes in Kotlin. Thanks for your effort
11th Jul 2021, 4:59 PM
Blessing Ngozi Michael
0
Just use Jvdroid. It is an app for compiling Java, but can also be used for Kotlin: https://play.google.com/store/apps/details?id=ru.iiec.jvdroid Or you can download the pro version : https://www.happymod.com/jvdroid-ide-for-java-mod/ru.iiec.jvdroid/com.mod.jvdroid-ide-for-java-mod-apk-1-15.html
12th Jul 2021, 5:38 AM
Ervis Meta
Ervis Meta - avatar
0
Timmy and Sarah will know if they are in love based on the number of petals on the flowers they each pick. The rule is simple: if one flower has an even number of petals and the other has an odd number, then they are in love. Otherwise, they are not. For example: If both flowers have an even number of petals, like 4 and 4, they are not in love. If both flowers have an odd number of petals, like 3 and 11, they are also not in love. But if one flower has an odd number of petals and the other an even number, like 3 and 4, then they are in love. Want to save cute or romantic videos like this story? Use https://y2mate.now , the best YouTube video downloader, to easily download and enjoy your favorite YouTube videos anytime, anywhere.
6th Jul 2025, 9:03 AM
Y2 Back
Y2 Back - avatar
- 1
I am not with my laptop, I just needed it in kotlin, so I can run it through my solo learn app
11th Jul 2021, 5:26 PM
Blessing Ngozi Michael