subject
Business, 18.02.2020 17:35 shylabear6536

Write a script to populate an array, called data_array, with 10 random values. Although you can do this with rand() directly, for this exercise create the array with the zeros() function and then use a loop using for, length(), and rand(), to assign values to the array elements. Compute the sum of the values in data_array, instead of using the sum() function. To do this, you must "accumulate" a result, which means that you first create a variable, called data_array_sum, to hold the accumulating result and initialize it to 0. Then loop through your array, updating the accumulating data_array_sum by adding each data_array value as you go: data_array_sum = data_array_sum + data_array(i); Finally, divide the data_array_sum value by the length of data_array, using the length() function and output the result along with the result of calling mean() on data_array, to show that they are the same.

ansver
Answers: 2

Another question on Business

question
Business, 21.06.2019 19:20
What is the most direct result of free trade supplying productive resources to areas where they're most needed? a. enhanced efficiency b. lower interest rates c. increasing specialization d. greater competition 2b2t
Answers: 3
question
Business, 22.06.2019 12:00
In mexico, many garment or sewing shops found they could entice many young people to work for them if they offered clean, air conditioned work areas with high-quality locker rooms to clean up in after the work day. typically, traditional garment shops had to offer to get workers to apply for the hard, repetitive, and somewhat dangerous work. a. benchmark competitive wages b.compensating differentials c. monopoly wages d. wages based on human capital development of each employee
Answers: 3
question
Business, 22.06.2019 14:00
How many months does the federal budget usually take to prepare
Answers: 1
question
Business, 22.06.2019 20:10
Your sister is thinking about starting a new business. the company would require $375,000 of assets, and it would be financed entirely with common stock. she will go forward only if she thinks the firm can provide a 13.5% return on the invested capital, which means that the firm must have an roe of 13.5%. how much net income must be expected to warrant starting the business? a. $41,234b. $43,405c. $45,689d. $48,094e. $50,625
Answers: 3
You know the right answer?
Write a script to populate an array, called data_array, with 10 random values. Although you can do t...
Questions
question
Computers and Technology, 19.03.2020 00:23
question
Mathematics, 19.03.2020 00:23
question
English, 19.03.2020 00:23
Questions on the website: 13722362