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
Service Revenue for the year = $80,000. Of this amount, $70,000 is collected during the year and $10,000 is expected to be colle
galina1969 [7]

Answer:

Net Cash Inflow from Operating Activities = $16,000

Explanation:

In the given information, it is not provided that cash is paid or not for Supplies, thus, assumed it was paid at the time of acquisition, and not in the current period when it is only charge to expense.

In that case, Cash generated from operating activities using direct method, shall be:

Cash flow from Operating Activities

Cash revenue collected = $70,000

Cash collected in advance = $2,000

Total cash inflow = $72,000

Cash paid for salaries = - $35,000

Cash paid for advertising expense = - $10,000

Cash paid for utilities = - $11,000

Total Cash outflow = - $56,000

Net Cash Inflow from Operating Activities = $16,000

6 0
3 years ago
One of your classmates was recently found to have cheated on the exam. Though furious, your instructor spoke to the student very
fiasKO [112]

Answer:

d. interpersonal justice

Explanation:

Interpersonal justice -

It refers to the practice of treating the people with proper respect and dignity , is referred to as interpersonal justice .

In case of any harmful , serious condition or activity , the practice of communicating or resolving the issue with the people in a very kind and respectful manner , is the sign of an intelligent or smart person  .

Hence , from the given scenario of the question ,

The correct option is d. interpersonal justice .  

4 0
3 years ago
July 31: during july, ps music provided guest disc jockeys for kxmd for a total of 115 hours. the contract requires ps music to
Cloud [144]

Answer:

The journal entries to record service revenue during July should be:

Dr Cash 3,600

    Cr Service revenue (80 hours per month) 3,600

Dr Accounts receivable [(115 - 80 hours) x $40] 1,400

    Cr Service revenue 1,400

Since the company has collected only the regular hours provided according to the contract, the remaining hours should be recorded as accounts receivable.

5 0
3 years ago
An import​ quota: A. Is always more costly to a country than an import tariff. B. Has the same effects on welfare as an import t
Ivahew [28]

Answer:

D. Generates rents that might go to foreigners.

Explanation:

An import quota is the trade restriction imposed by the government on the quantity of the particular commodity to be imported from another country. It protects domestic producers from foreign competition. Overseas goods are generally very cheap compared to locally produced goods, which can destroy a business from the market and can make foreign companies be the leader of the market, who can control the price and quality of the product. Therefore, it very helpful to the local producer in sustaining and generating profit in the market.

3 0
3 years ago
Paul’s will creates a General Power of Appointment Trust (GPOA) that distributes income to his wife annually for life and gives
Ivanshal [37]

Answer: D. The GPOA Trust automatically qualifies for the unlimited marital deduction because Paul's wife has a general power of appointment over the trust's assets.

Explanation:

General Power of Appointment Trust (GPOA) refers to a power of appointment which is a legally binding provision that's contained in a trust such that the beneficiary possess the authority to alter the beneficiaries of the trust.

In this case, Paul's wife possess the power of appointment to anyone on her behalf. Therefore, The GPOA Trust automatically qualifies for the unlimited marital deduction because Paul's wife has a general power of appointment over the trust's assets.

3 0
3 years ago
Other questions:
  • The monopolist, like the perfect competitor, will maximize profits at the output where marginal revenue equals marginal cost.
    6·1 answer
  • Johnna is 78 years old. She is deeply connected with nature, continuing to go for nature walks on a daily basis, and is very inv
    11·1 answer
  • How often do regulatory agencies track banks fiscal conditions? (Select all that apply.)
    14·2 answers
  • A 7-year municipal bond yields 4.8%. Your marginal tax rate (including state and federal taxes) is 39.00%. What interest rate on
    5·1 answer
  • Abbott Inc. owns 30% of the outstanding voting shares of Berta Inc. On the date of acquisition, the fair value of Berta's equipm
    12·1 answer
  • Which of the following statements is FALSE about opportunity​ cost? A. Opportunity cost exists only for goods with monetary valu
    7·1 answer
  • Elaborate on the meaning of contemporary socio-economic issues.​
    14·1 answer
  • TB MC Qu. 16-98 At the beginning of the recent... At the beginning of the recent period, there were 1,020 units of product in a
    10·1 answer
  • Some employees at a clothing manufacturer investigate pay rates on Salary and learn that the company has been paying them signif
    13·1 answer
  • if an organization (school, campus, or house of worship) wishes to prepare and plan for mass casualty incidents, an effective ap
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!