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
Leviafan [203]
3 years ago
14

What is the value of y when this code executes?

Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
4 0

Answer:

The operation of 6*x only executes if x is greater or equal to 0, since x=-10 and -10 is less than 0, the operation does not execute. For this reason,  the value of y using this code is None.

Explanation:

In python a function is defined with the syntaxis:  

def function(x):  

the operation to execute (x)

value to return

In this case, the function is foo and the parameter is x:  

def foo(x):

  if x>= 0:

     return 6*x

The code starts by assigning a value to x. Then, the code asks if the value of x is grater or equal to 0, if this condition is meet, then the code returns the value of 6 times x, if not, then the code does not return a value. In this case, x is -10 and this value is not grater or equal to 0. Given that the condition is not met, then the code stops executing and the value of y is none.

You might be interested in
Help it's the last question quickkk​
aniked [119]
I would say the answer is b, but ⟟ might be wrong
7 0
3 years ago
Examine the efficiency the various recovery algorithms used in deadlock handling
sineoko [7]

Solution:

The process of transaction can guarantee the reliability of business applications. Locking resources is widely used in distributed transaction management (e.g; two phase commit, 2PC) to keep the system consistent. The locking mechanism, however, potentially results in various deadlocks. In service oriented architecture, the deadlock problem becomes even worse because multiple transactions try to lock shared resources in the unexpectable way due to the more randomicity of transaction requests, which has not been solved by existing research results. In this paper, we investigate how to prevent local deadlocks, caused by the resource competition among multiple sub-transactions of a gl obal transaction, and global deadlocks from the competition among different global transactions. We propose a replication based approach to avoid the local deadlocks, and a timestamp based approach to significantly mitigate the global deadlocks. A general algorithm is designed for both local and global deadlock prevention. The experimental results demonstrate the effectiveness and efficiency of our deadlock prevention approach. Further, it is also proved that our approach provides higher system performance than traditional resource allocation schemes.

This is the required answer.

4 0
3 years ago
Rint "Censored" if userInput contains the word "darn", else print userInput. End with newline.
Marta_Voda [28]

If you're coding with C++ then the solution would be:

  if (userInput.find("darn") != -1) {

     cout << "Censored" << endl;

  }

  else{

     cout << userInput << endl;

  }

Keep in mind that this will reject any input with the word "darn" in the sentence. This will not filter the word darn if the capitalization is in different formats like "Darn, dArn, daRn, darN, DARN".

7 0
3 years ago
The difference between an AutoCorrect entry and a building block is that the building block feature makes corrections automatica
Bond [772]

Answer:

False.

Explanation:

The function of Building Blocks, that contains AutoText which is a helpful tool for incorporating a bulk of info into Word. For ease of access, the user could maybe create building blocks usable throughout the Quick Parts menu well into the Insert tab.

So, we can say that there is no major difference between autocorrect and building block, that's why the following statement is false.

5 0
3 years ago
Which of the following are true of e-mail communications when compared to phone or face-to-face communications?
ollegr [7]
They would be easily shared, from what I believe
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is a major plastics engineering project that is going on right now in Arizona?
    9·1 answer
  • Given the variables isfulltimestudent and age, write an expression that evaluates to true if age is less than 19 or isfulltimest
    12·1 answer
  • Writenames of eight output device.​
    8·1 answer
  • Ryan wants to ensure that all the words in this document are evenly spaced so that they look neat and readable . Which option in
    12·1 answer
  • A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
    11·2 answers
  • A device receives a Transmission Control Protocol (TCP) packet. The device understands where the actual data payload begins. Whi
    15·1 answer
  • Which component is a part of the CPU of a computer
    12·2 answers
  • Which principle suggests that specific single responsibility interfaces are better than one general purpose interface?
    13·1 answer
  • What statement best describes operating systems?
    12·1 answer
  • _________ can be used to provide access control, confidentiality, data origin authentication, connectionless integrity, rejectio
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!