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
You are a communication designer for a design company. Your team is working on a project designing an interior office space for
sammy [17]

This is incomplete because the question is missing, here is the missing question and options:

Which phase of team development does this situation describe?

A. Performing

B. Norming

C. Forming

D. Storming

The answer to this question is B. Norming

Explanation:

In team development, norming is the third stage in the process of creating a team and making its members work together. This stage occurs after members have known each other (forming) and had solved their problems (storming). Due to this, during this stage members are able to work together and there are clear roles, which facilitates communication and adaptation. This stage is the one described because roles have been defined "everyone is taking on leadership functions related to their roles" and it seems the integration after three months facilitates communication and changes "report back to the rest of the team and smoothly adjust the project plan."

5 0
3 years ago
CII, Incorporated, invests $710,000 in a project expected to earn a 9% annual rate of return. The earnings will be reinvested in
allochka39001 [22]

The total amount accrued, principal plus interest at a rate of 9% per year compounded 1 times per year over 12 years is $1,996,992.00.

<h3>Compound Interest</h3>

Given Data

  • Principal = $710,000
  • Rate = 9%
  • Time = 12 years

A = P + I where

P (principal) = $710,000.00

I (interest) = $1,286,992.00

Calculation Steps:

First, convert R as a percent to r as a decimal

r = R/100

r = 9/100

r = 0.09 rate per year,

Then solve the equation for A

A = P(1 + r/n)nt

A = 710,000.00(1 + 0.09/1)(1)(12)

A = 710,000.00(1 + 0.09)(12)

A = $1,996,992.00

Learn more about Compound Interest here:

brainly.com/question/24924853

#SPJ1

4 0
3 years ago
Look at the tables below, which show, respectively, the willingness to pay and willingness to accept of buyers and sellers of ba
jenyasd209 [6]

Answer and Explanation:

a. The equilibrium quantity for the given two tables is

As if the equilibrium price is $8 so the six consumers i.e bob, barly,bill,bart, brent, betty) are paying more than the equilibrium price and on the other hand six producers (carlos, courtney, chunk, cindy, craig, chad) are accepted the price as the equilibrium price is more than the accepted price

Hence, the equilibrium quantity is 6

b. Now if all the buyers are free to ride so the quantity supplied by private sellers is 0 as the minimum accepted price is more than the willingness price as producers is not able to produced

c. At imposing $2 per bag tax on sellers, the new equilibrium price is $9 as the price rise to $9

5 0
4 years ago
Mike begins an excavation on his land to construct a new building. The excavation causes a subsidence in neighboring lands and b
aalyn [17]

Answer:

Molly may not recover damages.

Explanation: According to land act molly may not recover damages.

  • Land law act is the body of law dealing with the right to exploit, alienate or exclude others from the land. In many countries, these forms of land are referred to as property or real estate, as distinct from personal property.
  • Through statute, a landowner has the right to the lateral protection of neighboring properties.
  • From the lands of your neighbors but your neighbors have the right to dig their land.
  • The neighbor's weight was the primary cause of the damage caused by ...

7 0
3 years ago
In January 2020, Sunland Company, a newly formed company, issued 10300 shares of its $8 par common stock for $13 per share. On J
balu736 [363]

Answer:

The correct option is the acquisition of these treasury shares decreased total stockholders' equity.

Explanation:

Initially the total stockholders' equity is $133,900 ($13*10,300) which comprised of $82,400  common stock ($8*10,300) $51,500 paid in capital in capital in excess of par value.

By repurchasing 1,030 treasury stock at $10,the total stockholders' equity decrease by $10,300,which leaves a balance of $123,600 ($133,900-$10,300).

In other words,the first option is the correct choice of answer

4 0
3 years ago
Other questions:
  • Day care for children is a competitive industry in​ long-run equilibrium at a price of​ $60 per day. In an effort to make day ca
    6·1 answer
  • Balloon paymeants are paymeants that are
    13·1 answer
  • The vigorous economic growth of the ASEAN countries is linked to the emergence of ________ as a major provider of technology and
    11·1 answer
  • If a firm adopts a production process that is costly in order to reduce pollution, the result is
    8·1 answer
  • ________ can be categorized as popularity, relevancy, and user satisfaction. a. Mobile search SEO b. Ranking factors c. SERP d.
    9·1 answer
  • A decrease in which of the following will increase the current value of a stock according to the dividend growth model?
    5·1 answer
  • Pasadena Candle Inc. projected sales of 800,000 candles for January. The estimated January 1 inventory is 35,000 units, and the
    6·1 answer
  • Jordan borrowed $10,000 so he could make some improvements to his basement. He will pay back the money (plus interest) by making
    10·2 answers
  • A company purchased treasury stock for $20,800. The treasury stock was initially issued for $16,500 and had a $6,800 par value.
    9·1 answer
  • marketing research helps managers gauge the perceived value of their goods and services, as well as the level of customer satisf
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!