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 Final

Rob B
Rob B
11,677 Points

C# Basics Final, #2 of 3 (try / catch)

I'm at a loss here. I have never been that good with try/catch and exceptions. I think I am just a little brain-fried right now.

Please bring a fresh pair of eyes to help me see what I've missed.

Ken Alger
Ken Alger
Treehouse Teacher

Rob;

Do you have some code we can take a look at to see exactly where you are stuck?

Ken

2 Answers

Hi Rob!

Do you have any particular code you need help with or are you looking for an explanation of try/catch? If you have any code that you want us to take a look at then feel free to post it right here.

-Luke

Rob B
Rob B
11,677 Points

NM, I think I figured it out. It was originally ok with the: var entry = Int32.Parse(Console.ReadLine());

However, in the next part, with try and catch, it needed a separation for the "try" block: var entry = Console.ReadLine(); Int num = Int32.Parse(entry); for (int count = 0; count < num; count++) { Console.WriteLine("Yay!"); }