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 trialAngus Eliott
3,793 PointsOrder of operations problem
am Doing a quiz on the order of operations and put in my best answer but it refuses it. have access to a computerized scientific calculator. How do I work it out?
1 Answer
Steven Parker
231,269 PointsYou just need to observe the language's operator precedence and associativity to be sure you are doing things on your calculator the way the computer would. Here is a documentation page with a chart showing precedence and order of evaluation.
For example, if the formula was "3 + 4 * 5
" the correct answer would be 23, not 35, since multiplication takes precedence over addition in the computer.
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 PointsLuc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 PointsIn this case you would put ( )s between what has to be calculated first