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: I keep winding up with compiling errors while attempting to run my code. Any help?

Steven Parker
Steven Parker
231,198 Points

That's a direct URL to your workspace, it's temporary and only exists while you are using it.

:information_source: But you can use the snapshot function in the workspace and provide the link to that.

2 Answers

https://w.trhou.se/9vgjpizqm3
I hope this works instead.

Steven Parker
Steven Parker
231,198 Points

The snapshot works perfectly, and persists when you're not using your workspace.

Steven Parker
Steven Parker
231,198 Points

You have a few issues causing compile errors:

  • on line 9, you assign runningTotal before it has been declared. Did you forget to put "int" or "var" in front?
  • on line 18 you have another undeclared variable named quit. Did you mean to put quotes around that?
  • on line 36 you have "elseif", but you probably intended to write "else if" (with a space in between)
  • on line 45 you have a stray equal sign between WriteLine and the parentheses that enclose the arguments.

It looks like you will still have a bit of work to do after that, but fixing these should get it to compile.