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
The Charade Company is preparing its Manufacturing Overhead budget for the fourth quarter of the year. The budgeted variable fac
In-s [12.5K]

Answer:

the total budgeted factory overhead for November is : 2) $110,000.

the budgeted direct labor hours for December must be : 3) 9,000 hours.

total budgeted factory overhead per direct labor hour is : 1) $14.38

Explanation:

To determine the budgeted factory overhead for November, prepare a budgeted factory overhead for November as follows :

<u>November</u>

Budgeted Variable factory overhead ($5.00 × 7,000 hours)  = $35,000

Budgeted Fixed factory overhead                                             = $75,000

Total budgeted factory overhead                                              = $110,000

<u>December</u>

Total Cash Disbursements                                                         = $105,000

Less Budgeted Fixed factory overhead  ($75,000 - $15,000) =  $60,000

Budgeted Variable factory overhead                                        =   $45,000

Therefore, budgeted direct labor hours = $45,000 / $5.00

                                                                  = 9,000 hours.

<u>December</u>

Budgeted Variable factory overhead ($5.00 × 8,000 hours)  = $40,000

Budgeted Fixed factory overhead                                             = $75,000

Total budgeted factory overhead                                              = $115,000

Therefore, total budgeted factory overhead per direct labor hour = $115,000 / 8,000 hours = $14.375

Which is $14.38 (rounded)

                                                               

3 0
3 years ago
Dave Ryan is the CEO of Ryan's Arcade. At the end of its accounting period, December 31, Ryan's Arcade has assets of $632,000 an
o-na [289]

Answer:

a) Stockholders' equity  = $411,690

b) Stockholders' equity  = $477,930

Explanation:

Accounting equation is defined as Assets = Liabilities + Equity.

a) If t the end of its accounting period, December 31, Ryan's Arcade has assets of $632,000 and liabilities of $220,310, the Stockholders' equity as of December 31 of the current year would be determined as follows:

$632,000 = $220,310 + Equity

Stockholders' equity  = $632,000 - $220,310

Stockholders' equity  = $411,690

b) If assets increased by $84,040 and liabilities increased by $17,800 during the next year, then Stockholders' equity would be determined as follows:

$632,000 + $84,040 = $220,310 + $17,800 + Equity

$716,040 = $238,110 + Equity

Stockholders' equity  = $477,930

8 0
3 years ago
9. Suppose an investor has two choices:Choice 1: invest in a Bond A which is a 2-year bond with an interest rate of 12% Choice B
statuscvo [17]

Answer:

the answer is (C) both of the choices would produce the same return

6 0
3 years ago
Intellectual Property can be protected by
mash [69]
The answer you are looking for is copyright
5 0
3 years ago
Suppose that a delivery company currently uses one employee per vehicle to deliver packages. Each driver delivers 60 packages pe
lisabon 2012 [21]

Answer:

a. What is the MRP per driver per day?

  • the marginal revenue product per driver = 60 packages x $20 = $1,200 per day

b. Now suppose that a union forces the company to place a supervisor in each vehicle at a cost of $300 per supervisor per day. The presence of the supervisor causes the number of packages delivered per vehicle per day to rise to 60  packages per day What is the MRP per supervisor per day? By how much per vehicle per day do firm profits fall after supervisors are introduced?

  • if the drivers were already delivering 60 packages per day without the supervisor, then the addition of the supervisor doesn't change anything. So the MRP of the supervisor is $0. That means that the company's profits will decrease by $300 per day due to the supervisors.

c. How many packages per day would each vehicle have to deliver in order to maintain the firm's profit per vehicle after supervisors are introduced?

  • $300 / 20 = 15 packages per day
  • in order to maintain the profit per vehicle, each team of delivery man + supervisor should be able to deliver 75 packages per day.

d. Suppose that the number of packages delivered per day cannot be increased but that the price per deliver might potentially be raised. What price would the firm have to charge for each delivery in order to maintain the firm's profit per  vehicle after supervisors are introduced?

  • $300 / 60 = $5
  • the price of each package delivered should increase by $5 to $25 per package.
6 0
3 years ago
Other questions:
  • For the past five years, the RS Company has produced and sold electronic magnets to chemistry labs throughout the United States.
    11·1 answer
  • The following transactions are for Oriole Company.
    8·1 answer
  • Dante’s employer pays for insurance for doctor visits and hospital visits. However, Dante has to pay for his own prescriptions.
    13·1 answer
  • Suppose you have a machine which executes a program consisting of 60% floating point multiply, 20% floating point divide, and th
    5·1 answer
  • When a potential business owner asks, "How can I improve on this?" it is an example of _________
    10·1 answer
  • What were your consideration in selecting your costumer?
    11·2 answers
  • The Granny Smith Company agreed to purchase the Red Delicious Company for $800,000. At the date of purchase, Red Delicious had c
    14·1 answer
  • Of customers who register a complaint, ________. all will do business with the company again because they are unwilling to dedic
    13·2 answers
  • What are hard skills?
    5·1 answer
  • On what moral basis is a permissive stance toward individual-willed choices and the acceptance of market transaction held to be
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!