1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OlgaM077 [116]
3 years ago
5

Consider the following code segment, which is intended to set the Boolean variable inRange to true if the integer value num is g

reater than min value and less than max value. Otherwise inRange is set to false. Assume that inRange, num, min, and max have been properly declared and initialized. 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; } Which of the following values of num, min, and max can be used to show that the code does NOT work as intended?a.num = 20, min = 30, max = 50
b.num = 30, min = 20, max = 40
c.num = 40, min = 10, max = 40
d.num = 50, min = 50, max = 50
e.num = 60, min = 40, max = 50
Computers and Technology
1 answer:
Natasha_Volkova [10]3 years ago
8 0

Answer:

Option d  num = 50, min = 50, max = 50

Explanation:

Given the code segment:

  1. boolean isBigger;
  2. boolean isSmaller;
  3. boolean inRange;
  4. if (num < max)
  5.        {
  6.            isSmaller = true;
  7.        }
  8.        else {
  9.            isSmaller = false;
  10.        }
  11.        if (num > min)
  12.        {
  13.            isBigger = true;
  14.        }
  15.        else {
  16.            isBigger = false;
  17.        }
  18.        if (isBigger == isSmaller) {
  19.            inRange = true;
  20.        } else {
  21.            inRange = false;
  22.        }

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.

You might be interested in
An Organization Chart to support the Appliance Warehouse case study The SWOT Analysis diagram you performed and created to suppo
Ulleksa [173]

<u>Explanation</u>:

Remember, the aim of SWOT Analysis is to perform analysis of a phenomenon or case.

Just as in any analysis it is followed by results and recommendations based on the set rules of the analysis.

<u>The Strengths, Weaknesses, Opportunity identified and Threats can translate to the mission statement </u>of a company. It is important to know that this statement is usually factual and accurate.

3 0
3 years ago
Instagram
Aleonysh [2.5K]
Uninstall instagram and install it again. log in and go to settings and fix up the notifications maybe that’ll work??

if it doesn’t, go to your apple settings and see if the notifications for instagram are on.

also try shutting your phone off for a few seconds if you do either one.
5 0
3 years ago
Patient letters created from __________ use structured data and do not require a large amount of typing from the medical assista
umka2103 [35]
Templates I think. not sure
3 0
3 years ago
The java class library interface queue method tagg retrieves the entey at the front of a queue but themrows a NosuchElementExcep
SCORPION-xisa [38]

Answer:D) peek

Explanation:Peek operation or function is the method that is used for the returning of the values on the front of the queue or stack type datatypes.               This operation function over those datatypes having group or collection of the elements and does not eliminate any element from the queue.

NOsuchElemnet exception is shown when there is the peek operation in the queue for the element to be displayed on the top and no deletion can take place .Thus, the correct option is option(D).

5 0
3 years ago
How many shared keys are required for a company of 70 employees who all need to communicate securely with each other?
kiruha [24]
I Think The Answer Would Be B Or D

7 0
3 years ago
Other questions:
  • You use Cat5e twisted pair cable on your network. Cables are routed through walls and the ceiling. A user puts a screw in the wa
    9·1 answer
  • Match each task with the features necessary to complete the task
    10·1 answer
  • Without protocols the information sent and received through the Internet would never reach its intended target and even if it di
    6·1 answer
  • Create a structure named planet This structure will contain distance from Earth as an integer Atmosphere, language, people and p
    8·1 answer
  • Select the tips you should follow when writing a business report.
    12·1 answer
  • Technical term of stealing personal information in social media.​
    5·1 answer
  • What aspects of your life are most influenced by media and technology​
    14·1 answer
  • Circuit pruning occurs only before puberty.<br> O True<br> O False
    9·2 answers
  • PLEASE HELP FIRST ONE TO ANSWER WILL GET BRAINLIEST!!
    10·1 answer
  • PowerPoint Online automatically saves your presentation to what Office Online application?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!