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
Where do players resurrect if they have been destroyed in a game?
CaHeK987 [17]

Usually back to their start point. Or a random place on the map.

3 0
3 years ago
Adding Web pages helps Web designers ___. Choose all answers that are correct.
ss7ja [257]

Answer:

B

Explanation:

7 0
3 years ago
To format an individual sparkline, select the sparkline you want to format, and then click the Ungroup button in the Group group
vichka [17]

Answer:

The answer is "Option a"

Explanation:

A Sparkline is a small graph, which is available inside a sheet, that displays information visually. It displays the information is in the form of patterns on several values. It also uses underline to display the low and high value, use with sparklines, and certain alternatives were wrong, which can be defined as follows:

  • In option b, It is used to define the overall view of data, that's why it is wrong.
  • Option c and Option d both are wrong because, create command is used to create data, or view is used to show that data, they both don't use sparkline option.  
3 0
3 years ago
Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)
Mnenie [13.5K]

Answer:

(1)Minterms complement = XYZ (2) Compliment of Minterms = Σm(0,1, 2 , 4 , 6) (3) (X+Y+Z) (4) Minimized SOP = Z + XY

Manterms = πM

Explanation:

Solution

Recall that:

Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)

(1) Canonical Disjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as minterms

In Minterm we assign 'I' to each uncomplimented variable and '0' to each complemented/complementary variable

For the given question stated we ave the following:

Minterms = XYZ, XYZ, XYZ, XYZ, XYZ.

(2) Canonical Conjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as maxterms.

In Maxterms we assign '0' to each uncomplimented variable and '1' to each complemented/complementary variable

Compliment of Minterms = Σm(0,1, 2 , 4 , 6)

Maxterms = πM

Note: Kindly find an attached copy of the complete solution to this question below.

6 0
2 years ago
Which website citation is correctly formatted according to MLA standards?
inysia [295]

Answer:

<em><u>The</u></em><em><u> </u></em><em><u>answer</u></em><em><u> </u></em><em><u>is</u></em><em><u> </u></em><em><u>C</u></em><em><u> </u></em><em><u>no</u></em>

Explanation:

<em><u>Hope</u></em><em><u> </u></em><em><u>it</u></em><em><u> </u></em><em><u>will</u></em><em><u> </u></em><em><u>help</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>dear</u></em><em><u> </u></em><em><u /></em>

7 0
2 years ago
Read 2 more answers
Other questions:
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • Enter the value of 5⋅(13.5−4.5). <br> ​
    5·1 answer
  • What are the pros and cons of editorial anonymity in Wikipedia
    10·2 answers
  • What is a parameter variable?
    8·1 answer
  • Which segment of society introduced the grunge look?
    5·2 answers
  • Charles would like to move his internet browser window so that he can see his desktop.He should
    5·1 answer
  • A ____________ is a network connection that typically carries encrypted data over the Internet to and from a remote access serve
    13·1 answer
  • Why save html documents as lowercase.?
    9·1 answer
  • Difference between positional and non positional number​
    12·1 answer
  • What are styles? built-in conditional formatting rules formatting applied with the Format Painter defined combinations of format
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!