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.

Andrej Pajenk
1,087 PointsPlease fill in the correct answer in each blank provided below.
l

Mazen Halawi
7,806 Pointsthe line of code will never execute. the code will not compile. because you are assigning a double value to an integer which will raise an error
2 Answers

Mazen Halawi
7,806 Pointsoops my bad, i just opened the view quiz and thought it was the only question there. thanks for pointing it out Steven!
The answer is 3.5 (i would follow Steven's direction and add to that calculate from left to right - keeping in mind y = 3 / 2 * 3.5 (start from left to right) y = (1) * 3.5 (3 / 2 = 1.5 but since its an int will return 1 y = (1 * 3.5) = 3.5

Matthew Hill
7,799 PointsCan you say why this parses from left to right instead of obeying operator precedence?

Steven Parker
221,106 PointsI think Mazen was looking at the wrong question.
But this is a tricky one. Here's a hint: The thing to remember is that the part of the calculation that is done on components that are integers has an integer result. Then that part gets combined with the double component to produce a double result. But that intermediate calculation is integer.

nfs
35,525 Pointsmy head's hurting.
But I did pass the quiz. This was the trickiest one.
Afrid Mondal
6,255 PointsAfrid Mondal
6,255 Points3.5