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
What is autofill in a excel spreadsheet?
Digiron [165]
Autofill is to automaticlly put the information in a spreadsheet
5 0
3 years ago
A growling noise is heard only when the driver exerts force on the clutch pedal. No noise is heard when the clutch pedal is up.
frosja888 [35]
Technician B is correct when you can hear growling only when the driver exerts force on the clutch pedal but not when it is up the Shaft Bearing is defective


3 0
3 years ago
Name the written test a potential driver must pass
Oliga [24]
In order to obtain a learners permit, teen drivers are required to pass a written test. Typically they will prepare for this exam by completing a drivers education course. Though not a requirement in all states, drivers ed is the easiest way to be thoroughly prepared for the complicated driving laws and scenarios you’ll face on the permit exam. Once you pass your permit test and earn a permit, there may still be certain restrictions attached to this provisional license — such as requiring a licensed driver over a certain age to be seated in the passenger seat, limiting your driving to daylight hours, and other state-mandated rules.
General United States Permit Requirements
While each state has its own set of guidelines, in general, teens between 14 and 18 years of age can start the drivers education and learners permit process. Once a teen driver has obtained a learners permit, there are additional state-specific requirements they must meet before they can apply for their drivers license.
Before obtaining a learners permit in any state, a teenager is required to pass a driving knowledge test. Drivers education is the best way for a teen to prepare for this exam, whether the state requires it or not. In some cases, passing a drivers ed final exam can substitute for the written exam. No matter how the test is taken, students must pass with at least a 70% or higher, depending on that state’s minimum. Once he or she passes, a teen driver will be issued a learners permit. Some states require teen drivers to have a permit for a minimum of 6 months before they can take their drivers license exam.

hope this helped :)
alisa202
7 0
3 years ago
What does cuda stand for
ludmilkaskok [199]
Compute unified device architecture
6 0
3 years ago
Read 2 more answers
8. Write the examples of freeware and Shareware softwares ?
lakkis [162]

Explanation:

People use freeware software because it is available free of cost and it can be distributed free of cost, that is why it is called FREEware.

Freeware software:

Adobe PDF

yahoo messenger

Go.ogle Talk

MSN messenger

People use shareware software because it helps them to know about the product more before buying it and this software is available free of cost.

Shareware software:

Adobe acrobat 8 professional

Winzip

Getright

7 0
3 years ago
Other questions:
  • Technician A says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the
    13·1 answer
  • Jen wants to protect the schools network from hackers,worms,and viruses.she also wants to regulate access to certain websites th
    15·2 answers
  • Identify four basic data manipulations performed on a relational database using sql
    7·1 answer
  • In microsoft what displays when the mouse pointer rests on selected text or data that can be formatted.
    8·1 answer
  • CRM software programs are designed to help companies gather all customer contact information into multiple data management progr
    13·1 answer
  • you want to enhance your Website visitors' experience. To do this, you need to know the type of browser that each visitor to you
    11·1 answer
  • Which of the following tasks will save a file over top of itself, using the same filename? A. Reload B. Save C. Save As D. Expor
    13·1 answer
  • How to enter date in a Date/Time field?​
    8·1 answer
  • The ability to present an effective message with useful content is obviously important to a good _____ presentation.
    11·1 answer
  • Which command must you use at the command prompt to determine the names of the network interfaces (including the isatap interfac
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!