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

General Discussion

There is a bug in this lesson that would give a runtime error.

I was just reviewing some things and found something that would cause a runtime error. https://teamtreehouse.com/library/objectivec-basics-3/practicing-with-immersive-examples/immersive-example-2-school-s-out

Here is the default in the lecture switch statement.

default:
            messageBody = @"No valid grade";
            break;

Because this switch statement is based on the currentGradeLevel condition, the switch does not catch the error if both the grade is invalid and the finalAverage is less than .70.

So if you use a finalAverage of less than .70 plus a grade below 9 or grade over 12 it will still print out, "Look forward to seeing you at summer school".

You might say summer school can apply to all grades but that's no good because even if grades 1-8 had summer school we still have a problem with anything above grade 12.

It's a good bonus exercise to fix the problem. lol