Reference no: EM131182168
Problem 1:
Write the function array_dup(n, obj) that returns an array containing n copies of obj.
>> array_dup(5, "hi")
=> ["hi", "hi", "hi", "hi", "hi"]
Ensure the array that gets returned contains independent copies of obj:
>> c = array_dup(5, [1,2])
=> [[1, 2], [1, 2], [1, 2], [1, 2], [1, 2]]
>> c[0].delete(1)
=> 1
>> c
=> [[2], [1, 2], [1, 2], [1, 2], [1, 2]]
Problem 2:
Write a function count_occurrences(a, obj) that counts the number of items in array a that are equal to obj.
>> a
=> [1, 2, 1, 3, 1, 4, 2, 5]
>> count_occurrences(a, 1)
=> 3
Problem 3:
Write a function insert(x, a) that takes an integer x and an array aof integers in nondecreasing order and returns a new sorted array that includes x and the integers of a. Your function should not modify a.
>> a = [2, 4, 5, 9, 12]
=> [2, 4, 5, 9, 12]
>> insert(5, a)
=> [2, 4, 5, 5, 9, 12]
>> insert(10, a)
=> [2, 4, 5, 9, 10, 12] >> insert(20, a)
=> [2, 4, 5, 9, 12, 20]
>> a
=> [2, 4, 5, 9, 12]
Determine the conditions on the coefficients
: Using the rref command on your calculator, determine the conditions on the coefficients in order for there to be a unique solution.
|
Improve the survey if it were to be repeated
: a. Using complete sentences, list three things wrong with the way the survey was conducted. b. Using complete sentences, list three ways that you would improve the survey if it were to be repeated.
|
Discuss the differences between legitimate and reward
: Discuss the differences between legitimate, reward, coercive, and referent power. Give an example of each or the appropriate uses of these expert powers
|
Markov analysis and forecasting
: 1. According to Markov Analysis and Forecasting describe the internal labor market of the company in terms of job stability, promotion paths and rates, transfer paths and rates, demotion paths and rates, and turnover rates?
|
Write the function array_dup
: Write the function array_dup(n, obj) that returns an array containing n copies of obj - Write a function count_occurrences(a, obj) that counts the number of items in array a that are equal to obj.
|
Did any of the other goals figure in this decision
: Which of the goals listed in Table 1.1 was most important to you (and perhaps to your family or community, if they were involved) in making this decision? Did any of the other goals figure in this decision? If you were to write up a list of your o..
|
Identify and describe a business crisis
: Identify and describe a business crisis situation and the main leaders involved. It could be one that you have experienced or have read about. Be sure to include a discussion of ethical implications
|
Dosages resembles a normal distribution reasonably closely
: In a sample of 100 syringes, the hospital's quality control officer finds the average dosage to be 0.5mL. The standard deviation of the dosage is 0.02 mL and the distribution of the dosages resembles a normal distribution reasonably closely.
|
How will you sell the product in that country
: What is the product that you plan to sell? - What foreign country do you plan to target? - How will you sell the product in that country?
|