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 Collections and Control Flow Control Flow With Conditional Statements Recap: Control Flow with Conditional Statements

Brian Uribe
Brian Uribe
3,488 Points

Am I missing some information?

There is this quiz, and the question it is asking me makes me feel like i'm missing some information. What am I not realizing with this question?

What's the question?

2 Answers

It evaluates to "not rare;" isAvailable and isCheap both evaluate to true.

Brian Uribe
Brian Uribe
3,488 Points

OH! I thought it wanted me to fill in the blanks, like isCheap && !isAvailable. Got it, thanks!

Brian Uribe
Brian Uribe
3,488 Points

OH! I thought it wanted me to fill in the blanks, like isCheap && !isAvailable. Got it, thanks!

Brian Uribe
Brian Uribe
3,488 Points
var isAvailable = true
var isCheap = true

var status: String

if !isCheap && !isAvailable {
    status = "super rare"
} else if isCheap && isAvailable {
    status = "not rare"
} else if !isCheap && isAvailable {
    status = "somewhat rare"
} else {
    status = "common"
}

What does status evaluate to? Choose the correct answer below: Skip Quiz Review Video Get Help Next Question A "not rare" B "common" C "somewhat rare" D "super rare"