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
To segment markets means to distinguish customers or markets according to common characteristics.
guapka [62]
Your answer is true that is what a segmented market is
7 0
3 years ago
From June to the end of September, Jennifer wants to save at least $1,500. Her monthly expenses are $600. Jennifer saves whateve
kakasveta [241]

The minimum sales required by Jennifer to meet her savings goal must be $26.25 per hour or $2100 for September.

Given that,

Savings desired = $1500

Monthly expenses = $600

Let money earned by her every hour be x

No. of scheduled work hours = 80

So,

Total money earned for the month = 80 × x

= 80x

As we know,

Money left = Total money earned - expenses

= 80x - $600 ...(i)

A.T.Q.

Money left must be = $1500

Then, by putting the variables in equation (i), we get

80x - 600 = 1500

Now, solving for  x

80x - 600 = 1500

        +600 = + 600

_______________

80x = 2100

x = 2100/80

∵ x = 26.25

Thus, the required sales are $ 26.25 per hour or ( 26.25 × 80 = $2100) for the month of September.

Learn more about 'savings' here:

brainly.com/question/18051939

4 0
2 years ago
the percentage of totoal workers who are out of work but seeking jobs and willing to work is known as the ___ rate?
liubo4ka [24]

Answer:

the unemployment rate

4 0
3 years ago
Read 2 more answers
the market value of the equity of Ginger, Inc., is $710,000. The balance sheet shows $45,600 in cash and $227,800 in debt, while
KengaRu [80]

Answer:

3.34 times

Explanation:

Ginger incorporation has a market valu of equity of $710,000

The debt is $227,800

Cash is $45,600

EBIT is $102,800

The first step is to find the enterprise value

= market capitalization + debt -cash

= $710,000 +$227,800 - $45,600

= $937,800-$45,600

= $892,200

The EBITDA can be calculated as follows

= EBIT + depreciation and amortization

= $102,800 + $164,600

= $267,400

Therefore the enterprise value-EBITDA can be calculated as follows

= 892,200/267,400

= 3.34 times

7 0
3 years ago
What are levels of production?
Vinil7 [7]

Answer:

first one

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • Target's liabilities exceed owners' equity.<br> a) true<br> b) false
    15·1 answer
  • Materials must have which two qualities in order to be classified as direct materials? a.They must be an integral part of the fi
    9·1 answer
  • Harrison Co. issued 13-year bonds one year ago at a coupon rate of 8 percent. The bonds make semiannual payments. If the YTM on
    8·1 answer
  • Which of the following were provisions of the Monetary Control Act of 1980? Check all that apply.
    9·1 answer
  • Why are debit cards not listed as money?
    10·1 answer
  • Foreign education loans interest subsidies by government for low income families in andhra pradesh.
    8·1 answer
  • When an airline industry, the military, and many other areas use scheduling programs to get the right people assigned to the rig
    5·1 answer
  • Four hospitals are located within a city at coordinate points P1=(10,20), P2=(14,12), P3=(8,4) and P4=(32,6). The hospitals are
    11·1 answer
  • The market consensus is that Analog Electronic Corporation has an ROE = 9%, has a beta of 1.25, and plans to maintain indefinite
    5·1 answer
  • In certain economy pple save part income in financial sector and use remaining part for consumption the govt decides to increse
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!