Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Lukas SarraldeCourses Plus Student 406 Points
Hi Guys, Can I get some heads up here? Thank you
I am not sure if i need to create some thing like:
and then use the Console.WriteLine(height)
string heightInput = "168"; int height = int.Parse(heightInput); Console.WriteLine(heightInput + "10"):
Antonio De Rose20,883 Points
3 errors 1) you should use height instead of heightInput in the last line 2) last line, for you cannot surround it with quotes. 3) after the last line, it should end with semicolon, and not colon
string heightInput = "168"; int height = int.Parse(heightInput); Console.WriteLine(height + 10);
Daniel TuratoJava Web Development Techdegree Graduate 30,124 Points
String heightInput = "168"; int height = int.Parse(heightInput); Console.WriteLine(height + 10);
Not much wrong with your code, just syntax. First off, you were converting the String to an int correctly but afterwards you was concatenating the previous "168" string with "10". If you wanted to do it with two ints, you had to use height + 10 with the "". Also, you accidentally used : instead off ; at the end of the last line. My above code shows what I corrected, hope this helps.