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

iOS Swift 2.0 Basics Swift Operators Assignment and Comparison

Mistake on challenge task 1

On Working With Operators it says "For the first task, we're going to keep it pretty simple and check if we know how to use the REMINDER and equality operators."

Brian Patterson
Brian Patterson
19,588 Points

I really don't understand what the task wants. It is really badly put together.

4 Answers

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I don't see what the mistake is in the task. The challenge wants you to do two steps in the same task:

// Enter your code below
let value = 200
let divisor = 5

let someOperation = 20 + 400 % 10 / 2 - 15
let anotherOperation = 52 * 27 % 200 / 2 + 5

// Task 1 - Enter your code below

let result = 200 % 5

// Task 2 - Enter your code below

let isPerfectMultiple = result == 0

Hi Caleb,

It should say remainder but it says reminder.

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

I also noticed a few spelling errors in the course.

It had also taken me a moment to understand the challenge due the way it was phrased regarding the Boolean result... But here is correct code with a short explanation:

// Enter your code below
let value = 200
let divisor = 5

let someOperation = 20 + 400 % 10 / 2 - 15
let anotherOperation = 52 * 27 % 200 / 2 + 5

// Task 1 - Enter your code below
let result = value % divisor
// Task 2 - Enter your code below
let isPerfectMultiple = 0 == result
// Task 3 - Enter your code below
let isGreater = someOperation >= anotherOperation

with the final task (3), it is asking you to compare the two example operations that are returning values to the constants "someOperation", and "anotherOperation", and after comparing this with an operand, to return a Boolean value of either "True" or "False" by using "Greater or Equal to (">=")"

With the example code above, if the value returned in the constant "someOperation" is greater or equal to "anotherOperation", then a Boolean will be returned to the constant "isGreater" of "True"...

In contrast, if "someOperation" is less than and not equal to "anotherOperation", than a Boolean value of "False" will be returned to our constant "isGreater" because of the specified "greater or equeal to" operand we placed in the code not being true.

Marina Alenskaja
Marina Alenskaja
9,320 Points

Seriously, what does the task want?! I understand the first to task about the remainder but then it gets confusing with the Boolean result..

I agree this task is POORLY put together....We re learning and this is just straight up confusing......How do we get through it??