Evaluate if the following function is a good candidate to be placed in a library. Why or why not?

Evaluate If The Following Function Is A Good Candidate To Be Placed In A Library. Why Or Why Not?

Answers

Answer 1

Answer:

It cannot be a good candidate because the creator of the library is attempting to update the global variables player1Points and player2Points. The updated scores for each player won't be retained unless someone creates the global variables player1Points and player2Points in their program.

Answer 2

The updateScore function is meant to update the point of player1 and player2 ; since the variables player1 and player2 are only defined in the function, then they do not have a global scope. Hence, the function isn't right to be placed in a library.

Variables defined outside a function are called global variables ; hence, they can be referenced anywhere within the program.

Since the function references a global variable, then any program which intends to use the function must have the variables player1 and player2 must be defined globally in the program.

Hence, it is not a good candidate to be placed in a library.

Learn more:https://brainly.com/question/20720413


Related Questions

What is output? Select all that apply. c = 0 while (c < 5): c = c + 1 print(c) 6 5 2 4 3 0 1

Answers

Answer:

2 4 3 0 1

Explanation:

The ___ function can be entered by clicking the cell where you want to add the funtion such as cell J6. Then click the arrow next to the autosum button and choose averange

Answers

Answer:

The name of the function that can be added to a cell below a column of numbers or to the right of a row of numbers to find the average by clicking on the AutoSum button on the HOME tab is;

Average

Explanation:

The average function is the function used to quickly find the arithmetic mean, 'μ', or average of a number group, x₁, x₂, x₃, ...xₙ, which is given by dividing the sum of the numbers by the count, 'n', of the numbers, as follows;

μ = ∑x/n

The AutoSum can be used to find the average in Microsoft Excel by clicking on the next cell to row of cells to the right or immediately below the column of cells, then clicking on the down arrow on the right of the AutoSum button on the HOME tab and selecting Average from among the options, the average of the numbers in the column or row of cells will be displayed in the selected cell.

Therefore, we have;

The Average function can be entered by clicking the cell where you want to add the function such as cell J6. Then click the arrow next to the AutoSum button and choose average

What stops the current loop and resumes execution at the next statement?
the break statement

the final statement

the pass statement

the infinite-loop statement

Answers

Answer:

break statement:))

Explanation:

The statement that stops the current loop and resumes execution at the next statement is known as the break statement. Thus, the correct option for this question is A.

What is the break statement?

The break statement may be defined as a type statement that effectively terminates the execution of the nearest enclosing do, for, switch, or while statement in which it considerably appears.

While performing the break statement control passes to this statement and follows the termination of the break statement very efficiently. The purpose of the break statement is to break or terminate a loop function as early as possible.  

Therefore, the break statement is the statement that stops the current loop and resumes execution at the next statement. Thus, the correct option for this question is A.

To learn more about Break statements, refer to the link:

https://brainly.com/question/14548592

#SPJ2

An audio recording has five minutes of silence at the beginning. Which audio-editing technique will delete this unwanted silence?

topping and tailing

normalizing

equalizing

dithering

Answers

Answer:

topping and tailing

Explanation:

Other Questions
8x-31 -715+ x/2 >8x/-6+149-34x+17-21 who can get this right Use the diagram to determine the value of x. As part of its commitment to quality, the J. J. Borden manufacturing company is proposing to introduce just-in-time (JIT) production methods. Managers of the company have an intuitive feel regarding the financial benefits associated with a change to JIT, but they would like to have some data to inform their decision making in this regard. You are provided with the following data:Item ExistingSituation AfterAdopting JITManufacturing costs as percentage of sales: Product-level support 15 % 4 %Variable manufacturing overhead 28 10 Direct materials 30 20 Direct manufacturing labor 20 13 Other financial data: Sales revenue $ 1,430,000 $ 1,810,000 Inventory of WIP 260,000 46,000 Other data: Manufacturing cycle time 60 days 30 daysInventory financing costs (per annum) 10 % 10 %Required:As the management accountant for the company, prepare an estimate the financial benefits associated with the adoption of JIT. Specifically, what is the estimated change in annual operating income attributable to the JIT implementation? warned that going to a temple was not enough all must work for just society please ive been stuck on this for days i need help please help on this one. PLSS HELP ME IN MATH!!!! Can someone please fill in the blanks in order!!!PLease hurry I need this fast What is x for -6x-7=4x-2 what is the distance between points (-2,3) and (-7,7)? 7x8y=94x+9y=22HELP FAST !!!!!!!!! Which word is the preposition? She was happy to sign her name near the top petition. give me 10 fact about elephants i need to know before i photograph them. I have a group of friends. One thing we have in common is that we all want a Tesla Model 3. We can all afford to buy a Tesla Model 3. However, we are all unwilling to pay the current price for a Tesla Model 3. Thus, my group of friends are not this:_______. a. cool in any sense of the word b. a market of potential Tesla customers c. a positioning market group d. a useful segmenting base Tony drives 2 times the hours that Monique does. Tony and Monique drive for a total of 12 hours.How long did each person drive? Find the 9th term of the geometric sequence 10, 40, 160, ... HELP ME!a/7 - 2/3 = 5/6 Explain two religious beliefs about forgiveness. Refer to sacred writings oranother source of religious belief and teaching in your answer. Your bill at a restaurant was for $36. You want to leave a 15 % tip. What would the tip amount be?$5.40$6.20$4.17$2.40Help please