1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mumz [18]
3 years ago
11

Write a for loop that iterates from 1 to numbersamples to double any element's value in datasamples that is less than minvalue.

ex: if minval = 10, then datasamples = [2, 12, 9, 20] becomes [4, 12, 18, 20].
Business
1 answer:
navik [9.2K]3 years ago
5 0

Answer:

for (i = 0; datasamples[i] < NUM_POINTS ; ++i) {

        if(datasamples[i] < minVal) {

        datasamples[i] = datasamples[i] * 2;

     }

 }

Explanation:

In this particular problem, we are trying to look at each value in the datasamples array, and double it. This calls for the use of an index variable.

The index variable will keep track of the position within the array as we move from left to right. Starting on the left, at index 0, we will move right until we are at the end of the array.

++i takes care of incrementing the index variable each time the loop runs. This is what moves through the array.

The termination condition checks whether if we have iterates all values in the array. Once you've gone past all the values in the array the  index variable is pointing all the way at the end.

As soon as the termination condition is false the loop will stop executing. So we will want to run your code while i (the index variable) is less than the size of the array (datasamples.length).

Once you've figured out the for loop bounds, simply check your conditional with an if-then statement before updating the values:

You might be interested in
There are many reasons why entrepreneurs start businesses. Mike Boyle likely started MBSC because _____.
Andrei [34K]

Answer:

Answer is B :) when you fill in the blank you can understand what I did

Explanation:

8 0
3 years ago
Read 2 more answers
The following expenditures were incurred by McCoy Company in purchasing land:cash price $61,440, accrued taxes $4,720, attorney’
Alex Ar [27]

Answer:

$76,240

Explanation:

Given that,

cash price = $61,440,

accrued taxes = $4,720,

attorney’s fees = $2,660,

real estate broker’s commission = $3,360, and

clearing and grading = $4,060

Cost of the land:

= cash price + accrued taxes + attorney’s fees + real estate broker’s commission + clearing and grading

= $61,440 + $4,720 + $2,660 + $3,360 + $4,060

= $76,240

6 0
3 years ago
Henrietta Marston plans to retire in the year 2050. She is considering a fund that will be more aggressive now and become more c
nadya68 [22]

Atnswer:

b. lifecycle fund

Explanation:

as from now to 2050 are still remaining 31 years, the money invested is able to go under different risk profiles, looking for getting the maximun return, the lifecycle fund is an excellent choice, it is because this kind of strategies changes according the risk of its costumer changes. it is expected to have during the first years a high exposition to risk such as equity or derivatives, and the more age of the costumer the lower risk profile, so the closer to 2050 the more expected investment into low risk assets, such as fixed income (this is made for having the less losses possible)

7 0
3 years ago
If 14,700 units are produced, the total amount of manufacturing overhead cost is closest to:
Vlad1618 [11]

Answer:

Total manufacturing overhead cost will be closest to 61,340  

Explanation:

As we can see there is not step-up fixed cost that is no additional fixed cost will incurred upon producing extra units, therefore fixed cost will remain same that is 37,820.

Variable overhead cost will increase with increase in units therefore, variable cost for producing 14,700 units will be 1.6 x 14,700 = 23,520.

To find total overhead cost we will simply add fixed and variable overhead cost:

Total overhead cost = fixed overhead cost + variable overhead cost

Total overhead cost = 37,820 + 23,520

Total overhead cost = 61,340

5 0
3 years ago
Angelina's made two announcements concerning its common stock today. First, the company announced that its next annual dividend
tensa zangetsu [6.8K]

Answer:

  • What is the maximum amount you should pay to purchase a share of Angelina's stock.

    $36,00

Explanation:

The dividend discount model state that the price of a stock should be the result of the Present Value of all of its future dividends, the Gordon growth model indicates that:  

Price per Share = D / (r - g)  = $2,16 / (0,10-0,04) = $36

Where:

D = the estimated value of next year's dividend  

r = The required rate of return

g = the constant growth rate

To this case the value is: $2,16 / (0,10-0,04) = $36

5 0
3 years ago
Other questions:
  • Gold Standard: French franc. Before World War I, $20.67 was needed to buy one ounce of gold. If, at the same time, one ounce of
    7·1 answer
  • A gum manufacturer wants to determine whether blue packaging or red packaging is preferred. The company performs a sales test by
    9·1 answer
  • In the construction of a new housing development, which factor of production can be categorized as land?
    8·1 answer
  • Elias, the manager of eat big chain of restaurants, gives awards on a monthly basis to employees with highest productivity. this
    11·1 answer
  • Omar and Penn want to discharge their contract by executing a new agreement with performance different from what they originally
    8·1 answer
  • An insurance agent is trying to sell you an immediate- retirement annuity, which for a single amount paid today will provide you
    12·1 answer
  • Prestige Company has determined the following information for its recent fiscal year. Days inventory outstanding 42.7 days Days
    6·1 answer
  • Miles uses the allowance method and wrote off the account of James. Miles then received $559 as partial payment on the account o
    13·1 answer
  • True or false: Electronic commerce is defined as the use of the Internet as an essential element of business activity.
    14·1 answer
  • (This problem combines material in Chapters 2 and 3.) You purchase a stock for $50 and sell the stock for $70 after three years.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!