Needed help with this question. (CodeChallange)
Someone, please help me with this! the question says: Convert the string in heightInput to an integer using int.Parse. Store the result in a variable named height. I tried everything and I could not get it to work..
string heightInput = "168"; string height = heightInput; int.Parse(heightInput);
Jennifer NordellTreehouse Staff
Hi there, Ibrahim! There are a couple of things going on here. First, we're trying to turn that string into an integer and then store the integer version of it in the variable
height, but you've declared
height to be of type
string. Secondly, you do use the
int.Parse method, but the result of that is neither displayed nor saved anywhere. It's just sort of floating out there in limbo.
Steps to take:
heightto be type int
heightto be equal to the result of running
I think you can get it with these hints, but let me know if you're still stuck!