0

How can I change this code so that when you type in "m" you get the answer "You are male."?

https://code.sololearn.com/cca56Kx6bG4F/?ref=app

12th May 2018, 12:16 AM
Methaniel InNylons
3 Réponses
+ 4
The mistake occurs at line 8 as we are comparing an integer with a character. This is possible as every character has a decimal equivalent like 'A' is 65, 'a' is 97 and so on. Therefore, just change the data type at line 6 to char will do. 😉
12th May 2018, 12:26 AM
Zephyr Koo
Zephyr Koo - avatar
0
So far- no matter which letter you type in-the only answer you get is "You are female."...
12th May 2018, 12:18 AM
Methaniel InNylons
0
Zephyr Koo Ahhh-that's where I went wrong.Thanks a lot for the fast and elaborate response.😀
12th May 2018, 1:12 AM
Methaniel InNylons