Welcome to the Treehouse Community
Looking to learn something new?
Mark McCuller3,539 Points
Objective-C Basics quiz on operations & expressions
I am having problems in passing this quiz on question #3 to #5. I know that from question #2 (int unstable=25, variable unstable -=5) thus the answer is unstable = 20. In question #3 “Auto increment the variable named unstable:” so 20 +1 =21 but this is wrong. What is the correct answer? In Question #4 “Auto decrement the variable named unstable:” 21 -1 =20 but this is wrong. What is the correct answer? Question #5 “Use the compact form of division to divide unstable by 3” is wrong also because question #4 is wrong. I assume the answers are added and subtracted to the unstable variable to the last question. Can someone help me understand what I am doing wrong, Thank you for your help. Mark
Amit BijlaniTreehouse Guest Teacher
As Michael mentioned you want to use the variable and use the ++ or -- operators to auto increment or decrement. Which would mean
You're 'manually' incrementing the variable by using "20+1". You'll want to use 20++. Conversely, decrementing would be --20. Compact division would be: unstable /= 3; as opposed to 'long hand' which would be unstable = unstable/3;