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:40
Two assets have the following expected returns and standard deviations when the risk-free rate is 5%: asset a e(ra) = 18.5% σa = 20% asset b e(rb) = 15% σb = 27% an investor with a risk aversion of a = 3 would find that on a risk-return basis. a. only asset a is acceptable b. only asset b is acceptable c. neither asset a nor asset b is acceptable d. both asset a and asset b are acceptable
Answers: 2
question
Business, 22.06.2019 11:50
After graduation, you plan to work for dynamo corporation for 12 years and then start your own business. you expect to save and deposit $7,500 a year for the first 6 years (t = 1 through t = 6) and $15,000 annually for the following 6 years (t = 7 through t = 12). the first deposit will be made a year from today. in addition, your grandfather just gave you a $32,500 graduation gift which you will deposit immediately (t = 0). if the account earns 9% compounded annually, how much will you have when you start your business 12 years from now?
Answers: 1
question
Business, 22.06.2019 12:30
Sales at a fast-food restaurant average $6,000 per day. the restaurant decided to introduce an advertising campaign to increase daily sales. to determine the effectiveness of the advertising campaign, a sample of 49 days of sales were taken. they found that the average daily sales were $6,300 per day. from past history, the restaurant knew that its population standard deviation is about $1,000. if the level of significance is 0.01, have sales increased as a result of the advertising campaign? multiple choicea)fail to reject the null hypothesis.b)reject the null hypothesis and conclude the mean is higher than $6,000 per day.c)reject the null hypothesis and conclude the mean is lower than $6,000 per day.d)reject the null hypothesis and conclude that the mean is equal to $6,000 per day.expert answer
Answers: 3
question
Business, 22.06.2019 17:10
Storico co. just paid a dividend of $3.15 per share. the company will increase its dividend by 20 percent next year and then reduce its dividend growth rate by 5 percentage points per year until it reaches the industry average of 5 percent dividend growth, after which the company will keep a constant growth rate forever. if the required return on the company’s stock is 12 percent, what will a share of stock sell for today?
Answers: 1
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, 11.03.2021 22:20
question
Mathematics, 11.03.2021 22:20
question
Physics, 11.03.2021 22:20
question
Biology, 11.03.2021 22:20
question
Mathematics, 11.03.2021 22:20
Questions on the website: 13722363