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, 22.06.2019 10:50
Jen left a job paying $75,000 per year to start her own florist shop in a building she owns. the market value of the building is $120,000. she pays $35,000 per year for flowers and other supplies, and has a bank account that pays 5 percent interest. what is the economic cost of jen's business?
Answers: 3
question
Business, 22.06.2019 12:50
Demand increases by less than supply increases. as a result, (a) equilibrium price will decline and equilibrium quantity will rise. (b) both equilibrium price and quantity will decline. (c) both equilibrium price and quantity will rise
Answers: 3
question
Business, 22.06.2019 16:30
Which of the following has the largest impact on opportunity cost
Answers: 2
question
Business, 22.06.2019 20:20
Garcia industries has sales of $200,000 and accounts receivable of $18,500, and it gives its customers 25 days to pay. the industry average dso is 27 days, based on a 365-day year. if the company changes its credit and collection policy sufficiently to cause its dso to fall to the industry average, and if it earns 8.0% on any cash freed-up by this change, how would that affect its net income, assuming other things are held constant? a. $241.45b. $254.16c. $267.54d. $281.62e. $296.44
Answers: 2
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
Mathematics, 24.09.2020 18:01
question
Mathematics, 24.09.2020 18:01
question
Business, 24.09.2020 18:01
Questions on the website: 13722360