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
Vikentia [17]
3 years ago
8

What expressions will initialize d with a random value such that all possible values for d are given by the inequality 1.5 ≤ d &

lt; 7.5?
Computers and Technology
1 answer:
Kaylis [27]3 years ago
7 0

Answer:

The solution code is written in Python

d = 1.5 + random.random() * 6

Explanation:

By presuming the Python random module is imported, we can use the <em>random</em> method to generate a random number.  <em>random.random()</em> will give us a value in the range [0, 1). The ensure the lower limit is 1.5 instead of 0, we can add 1.5 to random.random()

  •      1.5 + random.random()

This expression will give any value in range [1.5, 2.5)

To ensure the upper limit is set to 7.5, we tweak the previous expression to

  • 1.5 + random.random() * 6  

This expression will always multiply a random number from [0,1) with 6 and then only added with 1.5. This will always produce a random number that fulfill the inequality 1.5 ≤ d < 7.5

You might be interested in
Bob works in a small office with a network of computers. Bob, along with all the other employees, is responsible for securing hi
miskamm [114]

Answer:

False

Explanation:

When an employee becomes the one responsible for the security of His own computer then the scenario does not define Network security. Network security is a usage of hardware and related software to provide protection to the underlying network architecture from unauthorized access and other anomalies related to networks.

5 0
3 years ago
Is the disk in the C: drive fixable or removable disk
katrin2010 [14]

Answer:

The disk is a removable disk.

8 0
3 years ago
Read 2 more answers
True or false for a given set of input values, a nand
Katen [24]
Nand stands for "not and". The truth table for a nand is:

a b | a nand b
0 0 |      1
0 1 |      1
1 0 |      1
1 1 |      0

Hopefully this helps you answer your question.
6 0
3 years ago
A student has a ten-year-old desktop computer that she only uses for word processing, but she would like to start using it to pl
wariber [46]

Answer:

She should buy a new one or buy a Gaming PC to upgrade the setup.

Explanation:

6 0
3 years ago
What made the master so angry with his servant?​
sergeinik [125]

Answer:

what book?

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • __________ ensure that hardware and software produced by different vendors work together.
    14·1 answer
  • What can a parent do to help a child adjust to a new culture or area
    7·2 answers
  • True / Fasle
    13·1 answer
  • You are the administrator of the Sybex website. You are working when suddenly web server and network utilization spikes to 100 p
    15·1 answer
  • Which statements describe the use of styles in Word? Check all that apply.
    11·2 answers
  • (asking again because point-hogs exist)
    11·1 answer
  • Explain 3 categories of plagiarism​
    14·2 answers
  • Match each item with a statement below. - A popular port scanners that has the ability to use a GUI front end - Allows you to pi
    8·1 answer
  • In the computer science industry, the process of finding and removing errors from computer hardware or software is known as
    7·1 answer
  • Microsoft Word cannot be used to create personalized web<br> pages.<br> OTrue<br> False
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!