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
The most common layout of keys on the keyboard is the _____ keyboard.
Alex
The most common layout is called "QWERTY" because it is the first six letters on the keyboard.
6 0
3 years ago
Read 2 more answers
Explain how mobile phone production could be more sustainable​
erastovalidia [21]

Answer:

Sustainable design - the key features for sustainable phones are: use of sustainable and recycled materials, the use of less energy and efficient charging, durability, and last but not least they should be easy and inexpensive to repair.

5 0
3 years ago
Read 2 more answers
The elements in a long array of integers are roughly sorted in decreasing order. No more than 5 percent of the elements are out
USPshnik [31]

Question Completion with Options:

a. Ill only.

b. I only.

c. II and III only.

d. I and II only.

e. Il only

f. I and Ill only.

Answer:

The best method to use to sort the array in descending order is:

e. Il only

Explanation:

The Merge Sort is similar to the Insertion Sort but, it is better with its sorting versatility.  It repeatedly breaks down a list into several sub-lists until each sub-list consists of a single element and then, merging the sub-lists in a manner that results in a sorted list.  The Merge Sort has been described as a "divide and conquer" technique because of how it splits a list into equal halves before combining them into a sorted whole.

8 0
3 years ago
why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
Archy [21]
I would prefer the shortcut because it would make it easier to open tabs and close them too. but the can also help you with other stuff to .
4 0
4 years ago
HELP
Aleks [24]

Answer:

If a good friend comes to me for advice in pursuing a music career. With my knowledge of digital technology and the performing

arts, my advice to use digital technology to help build her career by <u>Delivering service to clients .</u>

Explanation:

<u>There were several reasons for this: </u>

• Being able to access work platforms and resources removed the need to travel back

to office bases because remote access allowed the completion of administrative

tasks where the practitioner was working.

• Working with clients in rural and isolated areas can prove difficult in terms of meeting

clients face to face and digital solutions helped to resolve this. This is because more

clients can be seen remotely than when practitioners must travel to see them.  

8 0
3 years ago
Other questions:
  • ________ is the presentation of information to the user and the acceptance of the user’s commands. a.data storageb.data access l
    7·1 answer
  • One of the visual tools that provides a graphical representation of the dataset object and enables you to set relationships betw
    13·1 answer
  • Which technology uses regular phone lines and transmits at speeds up to 256 kbps?
    15·2 answers
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • Design and implement a program (name it Youth) that reads from the user an integer values repressing age (say, age). The program
    6·1 answer
  • The proxy statement issued by a corporation is a requirement of: a. The Securities &amp; Exchange Commission (SEC) b. The Financ
    5·1 answer
  • What is wrong with the following C++ code? How would you fix it? int sum; for (int i=0; i&lt;1000; ++i) sum += i; { printf("Sum
    5·1 answer
  • What is the possible output from system.out.println((int)math.random() * 4)?
    8·1 answer
  • How does the Evaluate Formula dialog box help fix errors?
    9·2 answers
  • What are two benefits of defining a function?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!