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
12 Unless otherwise posted, in Florida, the speed limit for most municipal areas is 40 mph O 25 mph )45 mph 30 mph​
AVprozaik [17]

Answer:

I'd say 40 mph.

Explanation:

6 0
4 years ago
How can you differentiate between various economic systems that exist
liubo4ka [24]

Answer:

An economic system is defined by the way scarce resources are distributed in an economy.

There are 4 types of major economic systems which are following;

  1. A mixed economy is an economic system, like its name is a mix of elements of planned economies, free markets with intervention of the state and public enterprises.
  2. A command economy is a system where the government is key decision maker of what goods and services will be produced and introduced by the economy.
  3. A market economy is the one in which the investment, production and distribution are dictated by the forces of demand and supply.
  4. A traditional economic system is a result of customs, history and cultural norms which include the rules and manner of their distribution as well.
3 0
3 years ago
Kraven Corp. borrows $100,000 by signing on a 1-year, 8% promissory note from General Finance Company and assigns $120,000 of it
Aleks [24]

Answer and Explanation:

The journal entry is shown below:

Cash Dr $98,800

Finance charge Dr ($120,000 × 1%) $1,200

       To Liability - Financing Arrangement $100,000

(being receipts of cash is recorded)

Here cash and finance charge is debited as it increased the assets and expenses and liability is credited as it also increased the liabilities. Also, the cash & expenses contains normal debit balance and liabilities contains normal credit balance

6 0
3 years ago
"Jen operates Jen's Fruits &amp; Vegetables, a small market stocked entirely with produce grown on her adjacent farm. Under what
GarryVolchara [31]

Answer:

The federal government can regulate Jen's activity citing the supreme court rule of the government ability to regulate any activity interstate or intrastate that affects interstate commerce.

In the line of this argument it means that a farmer growing and of goods affects interstate commerce.

The farmers best argument concerning the federal government regulating their activities due to interstate commerce is that his activities are purely local and although I don't believe any court will hear him out.

Explanation:

6 0
3 years ago
Use this image to answer the following question. The ice cream shop needs about two pounds of cocoa for each gallon of chocolate
navik [9.2K]
I think this is a trick question. Say, there are 2 pounds of cocoa / 1 gallon of chocolate ice cream. But then the problem only mentions the production of eight gallons of <em>strawberry</em> ice cream, not chocolate ice cream.

However, if they're somehow related (like they are made from the same machine), then you need 16 pounds of cocoa to produce 8 gallons of chocolate ice cream. 
3 0
3 years ago
Other questions:
  • Smith operates a roof repair business. This year Smith's business generated cash receipts of $32,000 and Smith made the followin
    11·1 answer
  • In microeconomics, what term refers to the measurement of responsiveness of the quantity demanded or the quantity supplied to a
    5·1 answer
  • William pays his $500 premium every 6 months for automobile insurance with collision coverage. His deductible is $750. William c
    13·2 answers
  • Suppose that while melissa was on the coast, she also spent two days sightseeing the national parks in the area. to do the sight
    12·1 answer
  • Ashley's Coffee Shop makes a blend that is a mixture of two types of coffee. Type A coffee costs Ashley $4.30 per pound, and typ
    14·1 answer
  • "The gross earnings of factory workers for Dinkel Company during the month of January are $400,000. The employer's payroll taxes
    9·1 answer
  • "Have you considered paying workers for what they produce? I found that when i paid employees by the pice, their productivity we
    6·1 answer
  • During 2021, its first year of operations, a company provides services on account of $257,000. By the end of 2021, cash collecti
    8·1 answer
  • 500 divided by 2/3 = 500 * blank = blank feet <br><br><br>please help me
    13·1 answer
  • Why Projects that arise as a result of problems and directives must be resolved quickly to avoid hurting an organization’s busin
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!