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
A Venn diagram is used to show...?<br> Plz help
11Alexandr11 [23.1K]
Venn diagrams are used to depict set intersections (denoted by an upside-down letter U)......
6 0
3 years ago
Read 2 more answers
For a sample of 100 students, the median number of text messages sent per day is 90, the first quartile is 78, and the third qua
crimeas [40]
Less than 78, more than 102,
4 0
3 years ago
Present a detailed data model for your project scenario. You can create your data model using Microsoft Visio 2010, which you wi
Troyanec [42]

Answer:

THE FARMERS PRICE CENTER

The farmer's price center is about helping farmers acquire farm inputs easily

and conveniently. Through relevant branches and supportive statt, the farmers

price center provides a fresh perspective on the day to day hardships that farmers

Tace. The tarmer's price center is run by a practicing tarnmer with tirst hand

information as he holds a bachelors degree in agriculture. His unique perspective

allows farmers to automatically connect with his point of view. The farmer's center

is equally informal as it is also a mentor or a friend. Besides selling farm inputs,

the center guides tarmers overcome their challenges.

The tarmer's price center addresses the tarming and tarming management

sector. The people who purchase from famers price center are either practicing

tarmers or want to start a venture in agriculture. They have a natural drive to create

agricultural products and seek out professional advice. The ideal customer for the

farmer's price center would be the new farmer or investor who wants to start an

agricultural venture or manage their firm better. The farmer's price center provides

a comprehensive resource that answers the questions farmers have while at the

same time giving thema step by step way to succeed. Mostly, farmers do not have

The farrmers price center will be getting 5,000 unique customers per month

and be ranked as a pace setter and a trusted mentor and be ranked as a leader in

agricultural products and advice site. To achieve these long term goals, the

Tarmer s price center needs to apply imbound marketing te chniques to get tound.

Part or this strategy will be to contract sales representatives to market the varlous

products to the retail shops across the countryside. These sales representatives are

to be paid a retainer and commission upon hitting their sales target. The (products

are transported by our fleet of trucks to the customer's premises. Payment shall be

made on cheque at the end of the month according to the number of products

delivered. Each sales representative shall prepare a report on their daily sales with

accordance to their specitic routes.

ne raners price center is all about neiping ramers tnve n tne cndotic

world of business filled with scrupulous products. The farmer's price center will

achieve upwards of 5,000 unique customers and S10,000 in revenue per month

within the next two years.

6 0
3 years ago
Emilio has created a document in Word and needs to print labels. He is shopping at a store and finds Avery labels
mars1129 [50]

Answer:

He needs to check to see if they are compatible with Word

Explanation:

A label is a attachment to an object, with the aim of identifying the object such as the mail to address on an envelop, In MS Word, there several label templates to choose from, which are located under the Mailings tab

To create a label in MS Word, we have the following steps

1) Select Labels under the Mailings tab

2) Select the Options button in the Labels dialogue box, then select the label vendor and the product of the vendor to be used

3) Enter the address of the mail in the Address box after selecting the vendor

Therefore, Emilo being at the shopping center rathe then on his computer will only have access to check if the cheaper label is also compatible with MS Word, from the label vendor's specifications

7 0
3 years ago
__________________ are evaluations of a network
BigorU [14]

Answer:

 The evaluation of the network is basically depend upon the various factors such as the stage, type and size of the network development. The main purpose for the evaluation of the network is that the system works with high efficiency without any interruption in the network.

According to the size and the type of the network we can easily evaluate the particular network in the system and then we can easily work on the network infrastructure to make the network more efficient.

7 0
3 years ago
Other questions:
  • Brian needs to assign a macro to a button on the ribbon. Where should he go to achieve this goal?
    13·2 answers
  • As the team leader, John ensures that all his teammates are clear in the team goals they need to achieve. He demonstrates the qu
    12·2 answers
  • An isp is a group of updates, patches, and fixes that apply to specific oss.
    14·1 answer
  • A person who has a been exposed to technology at a young age is?
    8·1 answer
  • 4.5 Code Practice
    15·1 answer
  • Another name for divergent boundaries that occur under the ocean is
    6·2 answers
  • What is the term for the era created by the digital revolution?
    5·1 answer
  • the front desk of the Nocete's Hotel will comlute the total room sales (TRS) of Room 101.The room was occupied three times and t
    6·1 answer
  • Which of the following protocols is used by an email client to retrieve messages from an email server, giving users the option t
    11·1 answer
  • a company recently implemented a secure sockets layer/transport layer security (ssl/tls) version that supports secure hashing al
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!