Answer:
what is the question
Explanation:
you didnt post a question
Answer:
Option d num = 50, min = 50, max = 50
Explanation:
Given the code segment:
- boolean isBigger;
- boolean isSmaller;
- boolean inRange;
- if (num < max)
- {
- isSmaller = true;
- }
- else {
- isSmaller = false;
- }
-
- if (num > min)
- {
- isBigger = true;
- }
- else {
- isBigger = false;
- }
-
- if (isBigger == isSmaller) {
- inRange = true;
- } else {
- inRange = false;
- }
If we have num = 50, min = 50 , max = 50, the condition num < max will be evaluated to false and therefore isSmaller is set to false.
The condition num > min will be evaluated to false as well and therefore isBigger is set to false.
Since isSmaller and isBigger are both false and therefore isBigger == isSmaller will be evaluated to true and set the inRange = true. This has violated the statement that if the integer value num is greater than min value and less than max value, then only set inRange to true. This is because num = 50 is neither greater than min nor less than max, it is supposedly not in range according to the original intention of the code design.
Use PEMDAS.
6 + 3(4) / 6
6 + 12 / 6
6 + 2 = 8
6 / 6 = 1
8 / 1 = 8
I hope this helped.