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! While you're at it, check out some resources Treehouse students have shared here.

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

C# C# Basics (Retired) Perform Converting Strings to Integers

I do not really understand the task, I have declared height but nothing happens .

Adding 10 to height and store it into height? 2 of 2

If I understand the question correctly , it is so that I'll add 10 in height , which in turn should be returned.

I have searched some but not been able to crack it. I saw two exempelar which is ( height + = 10; ) and another exemple ( height = height + 10 ;) . please help me , are going crazy =(

CodeChallenge.cs
string heightInput = "168";
string height = "10";
int height = int.Parse(heightInpu);

1 Answer

Afrid Mondal
Afrid Mondal
6,255 Points

Hey ahmad, you forgot to add a "t" to your variable heightInput. And 2nd task is asking you to add 10 to height and assign it back to height. What you are doing here just assigning the 10 value as a string to height. It is wrong here.

string heightInput = "168";
int height = int.Parse(heightInput);
height = height + 10;

Thanks Afraid of observation and assistance. Hope it will work.