Checkpoint 23.7.1.
What would be printed if you moved lines 6-7 before lines 4-5 and set x equal to .5?
- x is in the first quartile - x <= .25
- This will only print if x is less then or equal to .25.
- x is in the second quartile - .25 < x <= .5
- This will print if the other if’s were not true, and if x is less than or equal to .5. By moving lines 6-7 before lines 4-5 this will never print.
- x is in the third quartile - .5 < x <= .75
- This will print if the other if’s are not true and if x is less than or equal to .75. So, moving lines 6-7 before lines 4-5 messes up what this code is intended to do and incorrectly prints that .5 is in the third quartile.
- x is in the fourth quartile - .75 < x <= 1
- This will only print if all of the other ifs are false.