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) Perfect if / else if / else

Delaine Teddy R Ndau
Delaine Teddy R Ndau
3,437 Points

if/ else if/ else

i keep on getting a compiler error although i dnt seem to be missing anything my program if refusing to compile wat do i do need help asap

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Delaine Teddy R Ndau ! I received your request for assistance, but unfortunately am unable to assist without your code. If you're doing this in Workspaces, I would recommend that you make a snapshot of your workspace so that we can fork it and have a look around. I look forward to hearing back! :sparkles:

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Delaine Teddy R Ndau! The first compilation error you are getting is an "unexpected end of file". This means the compiler was expecting the code to continue but it never did. This happens when we forget to add an ending closing curly brace at the end of the file. Such is the case here. If you add an additional closing curly brace at the end this error will go away.

However, once this is fixed you will be presented with two new compilation errors. One will be that keppGoing is not defined in the current context. On line 20, you wrote keppGoing = false;. But you meant to write keepGoing = false. Note the spelling of "keep". The second syntax error will be that int does not contain a definition for parse. Note the capitalization here. Almost everything in programming is case-sensitive. The data type int has no method for parse, but it does have one for Parse.

So where you wrote:

int minutes = int.parse(entry);

That should be:

int minutes = int.Parse(entry);

Once these three minor details are fixed, your code will compile and run. Hope this helps! :sparkles:

Delaine Teddy R Ndau
Delaine Teddy R Ndau
3,437 Points

okay thanks ill try it out and ill get back to you in a few but im still lost as to where im suppose to put that curly brace exactly where am i suppose to put it