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
Which of the following statements is false? People tend to shortcut security procedures because the procedures are inconvenient.
Dahasolnce [82]

Answer:

E. The online commerce industry isn’t willing to install safeguards on credit card transactions.

Explanation:

With the advent of several online platforms for commercial transactions and with the risk associated withe these transactions, the online commerce industry avails themselves to measures that could curb fraudulent activities. One of such means used in preventing fraud is the use of a high quality payment processor which enables an efficient payment and the verification of the customer's details before transaction.

They also employ the act of storing data so as to avoid requesting too much data from the customers. The use of Secure Sockets Layer, a cryptographic means for digital security is also used by these online sites. Several other measures are employed by businesses to ensure safety during transactions.

8 0
3 years ago
Click here for a answer
Hatshy [7]

Answer:

the 3th one

Explanation:

3 0
2 years ago
Turning up the transmit power or utilizing a high gain antenna to reach wireless users from a distance increases your exposure t
Sholpan [36]
Turning up the transmit power or utilizing a high gain antenna to reach wireless users from  distance increases your exposure to radiofrequency radiation.
8 0
3 years ago
A person who creates a computer virus is a (1)system analyst (2) techician(3) programmer​
mars1129 [50]

Answer:

a person who creates a computer virus is a programmer

8 0
3 years ago
Read 2 more answers
Sometimes news organizations have biasis because
elena55 [62]
Every person has their own personal beliefs, we are all human, so sometimes the news can include biasis because someone put their personal opinion in what they say/write.
5 0
3 years ago
Other questions:
  • Which functions are performed by server-side code??​
    10·1 answer
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • John would like to move from the city into the suburbs and has been saving up a large down payment for a home. Which is the most
    7·1 answer
  • According to the video, what education and experience do employers look for in Reporters and Correspondents? Check all that appl
    10·2 answers
  • Using a caesar cypher with an offset of three characters (a -&gt; d, b -&gt;e, ...., z -&gt; c), what would be the correct cyphe
    6·1 answer
  • How can your network be infected with malware or ransomware?
    6·1 answer
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • The term Linux Intrusion Detection System ( LIDS) refers to a command that allows an administrator to run processes as root with
    5·1 answer
  • Write a function called changeCharacter that takes three parameters – a character array, its size, and the replacement character
    15·1 answer
  • What do earthquakes and tsunamis have in common?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!