Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Objective-C Basics Introduction to Operators and Conditionals Review IF / ELSE

it says task1 is no longer passing?

what am i doing wrong?

bool hasBonus;
int powerPoints=5;

if (powerPoints > 3) {
  hasBonus = false;
} else {
  hasBonus = true;

You'll need to declare hasBonus, and powerPoints as a variable, or constant before you provide the output type of bool, or int. Is this question tied to a particular lesson, or just a general question? If I was clear on the expected result I might be able to assist more clearly.

Below, is a spin off what you made above. It might be something you could use as a guide or template to help solve your issue. If you copy the content below in a playground you'll see how the print values change when the powerPoints variable is modified from 6 to another number.

var powerPoints = 6

if powerPoints > 3 { print("True: (powerPoints) is greater than 3") } else { print("False: (powerPoints) is less than 3") }

I hope this helps.