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]
2 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]2 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
If the general education level within a country rises significantly over time, it is likely that: the country’s production possi
kiruha [24]

Answer: Option (D) is correct.

Explanation:

Correct: The country’s production possibilities curve will shift out.

The production possibility frontier shows different combination of two goods that are to be produced with the available resources. It also shows the point on the curve which represents the efficient level of quantity to be produced.

So, if there is any improvement in the factors such as technology advancement and level of education will generally results in higher economic growth and increase in the level of output.  

Hence, there is an outward shift in the production possibility frontier.

6 0
3 years ago
The unequal distribution of wealth, income, power, and poverty is called
OverLord2011 [107]

The answer to this question is social inequality. Social inequality is the unequal amount of opportunity and reward that is given to a person depending on their race, gender, age, or class. Social inequality can be categorized into 5 types such as political inequality, income inequality, life inequality, inequality of membership, and inequality of treatment.

5 0
3 years ago
How can cybercriminals harm a person whose personal information they have stolen?
Leokris [45]
When a person obtains someone else's personal information, these are some thing that could potentially happen that would harm the person whose identity has been stolen: Open new lines of credit (can harm your credit and incur debt). Seek medical attention (could be harmful by getting incorrect medical information on your record, or incurring debt). Drain savings and retirement accounts Provide an alias when arrested (harmful if the cops look for you when the other person runs, or if the other person uses your information to pay bail. Get a job and file false tax returns (could be harmful when the IRS sees the records and <span>thinks that you are not paying taxes on all of your income).</span>
3 0
3 years ago
A business goes to the trouble and expense of segmenting _________.a. its markets when its customers are dissatisfied. b. it exp
malfutka [58]

Answer:

b. it expects that this will increase sales and profits

Explanation:

6 0
3 years ago
Why must real options have positive​ value? ​(Select all the choices that​ apply.)
yarga [219]

Answer:

A. Real options must have positive value becasue they are only exercised when doing so would increase the value of the investment.

B. If exercisung the real option would reduce value, managers ca allow the option to go unexercised.

D, Having the real option but not the obligation to act is valuabale.

Explanation:

Because real option are options or choices made available to managers of a firm concerning investment their choices are meant to bring about a positive growth and return on the investments.

So if any of the choices presented to these managers are going to reduce the values or have other negative impacts on the investment and its value, then the option which is the real option or ideal option canbe forgone.

Cheers.  

5 0
3 years ago
Other questions:
  • Sales and marketing activity in international markets can be blocked by ______, which emphasize a country’s interests above all
    15·1 answer
  • Yale Company purchased equipment having an invoice price of $21,500. The terms of sale were 2/10, n/30, and Yale paid within the
    11·1 answer
  • In 2018, Borland Semiconductors entered into the transactions described below. In 2015, Borland had issued 180 million shares of
    5·1 answer
  • Thế nào là toàn cầu hóa thị trường, toàn cầu hóa sản xuất?
    10·2 answers
  • Difference between real flows and monetary flows​
    9·1 answer
  • When an accounts payable ledger is used, the Accounts Payable account in the general ledger becomes a(n) __________ account.
    15·1 answer
  • With regards to interpretation, what are the important areas that appear on a cvp graph?.
    6·1 answer
  • Brand equity results in lucrative brand Blank______ opportunities, when another company wishes to pay a royalty or fee to use yo
    5·1 answer
  • You are researching a stock currently priced at $35 per share. Call options are currently priced at $3.00, and puts are priced a
    15·1 answer
  • At the output level defining allocative efficiency: Group of answer choices the maximum willingness to pay for the last unit of
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!