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
Sandra Kristof sells furniture for McKinney Furniture Company. Kristof is having financial problems and takes​ $650 that she rec
rusak2 [61]

Answer:<u><em>The cash register will alert Megan​ McKinney, the​ controller, that something is​ wrong.</em></u>

In this case the cash register provides control over the cash receipts. When Kristof, took the cash from the register , the records from the register will not match the cash in the register.

The cash in the cash drawer will be $650 lower than the amount recorded in the cash register.

5 0
2 years ago
Explain the difference between a depository institution and a non-depository institution.
WINSTONCH [101]

Explanation:

First, Depository institution

Institution that collect money from people and pay interest . You may can deposit your cash and withdraw it anytime . If you put longer they pay interest. Interest may be fixed or variable. On other words, from that institution you can send your money to other people ,can get credit or debit card to withdraw or shopping. They gave you loans. Such institution are:

Commercial bank , Saving institution,credit union and so on.

In last remember that those who pay you interest ,give loan facilities, business transaction and collect your money they are Depository. They have 3 types of account for people who want to deposit their money. 1. Current account 2. Saving Account 3. Fixed

Non Depository institution

Where you cannot put your money and withdraw it . You would not get interest. They are intermediary between borrowers and saver. They are:

Mutual funds: where you buy scheme in units. It like investment . Then they pay you bonus and even you can sales it on market. Don't confuse mutual funds collect money from public invest it on market and share their profit.

Insurance companies: they insure your belonginess. They pay when your things goes beyond the normal level. Like. Car theft,goods damage.

Pension fund:

Security firms: investment companies ,broker house.

8 0
3 years ago
matt, a shareholder, can run for director by simply placing his name on the company's proxy statement. True or False?​
IgorLugansk [536]
False

Reason: A Shareholder cannot go for the director's by writing his name on the proxy Statement. Instead he has to place his name on the AGM or Annual General Meeting, where Shareholders meet, propose for their plans and Vote for The Company's Director.
6 0
3 years ago
Precision Construction entered into the following transactions during a recent year.
shusha [124]

Answer:

Jan-02

Dr Bulldozer $ 250,000

Cr Cash $ 20,000

Cr Note Payable $ 230,000

Jan-03

Dr Bulldozer $ 20,000

Cr Accounts Payable $ 20,000

Jan-30

Dr Accounts Payable $ 20,000

Cr Cash $ 20,000

Feb-01

Dr Repair and Maintenance Expense $ 800

Cr Cash $ 800

Mar-01

Dr Computer Software $ 3,600

Cr Cash $ 3,600

Explanation:

Preparation of the journal entries for each of the above transactions.

Jan-02

Dr Bulldozer $ 250,000

Cr Cash $ 20,000

Cr Note Payable $ 230,000

(Purchased bulldozer)

Jan-03

Dr Bulldozer $ 20,000

Cr Accounts Payable $ 20,000

(Replaced tracks on bulldozer)

Jan-30

Dr Accounts Payable $ 20,000

Cr Cash $ 20,000

(Paid cash)

Feb-01

Dr Repair and Maintenance Expense $ 800

Cr Cash $ 800

(Repaired seat of bulldozer)

Mar-01

Dr Computer Software $ 3,600

Cr Cash $ 3,600

(Purchase computer software)

8 0
2 years ago
“Gambler fallacy” is the Believe that if people keep gambling they will eventually win big
Elena-2011 [213]
The answer is False

Hi hope you doing well!
6 0
2 years ago
Other questions:
  • your friend is over spending and in need of a budget whtat type of expenses should they reduce next month?a. buy fewer school bo
    11·1 answer
  • An income statement for Sam's Bookstore for the first quarter of the year is presented below:Sam's BookstoreIncome StatementFor
    13·1 answer
  • Misty Company reported the following before-tax items during the current year: Sales revenue $ 1,200 Selling and administrative
    11·1 answer
  • Why is there so much government regulation involving social responsibility issues? Should there be less?
    5·1 answer
  • The Sarbanes-Oxley Act of 2002 holds a public company's ________ responsible for the accuracy of thr firm's financial statements
    5·1 answer
  • Consider an oligopoly industry whose firms have identical demand and cost conditions. If the firms decide to collude, then they
    7·1 answer
  • I'll give Brainliest to whoever has the best answer.
    9·2 answers
  • The estimated factory overhead cost for a Co. is $1750000 for the year. Direct labor hours are estimated to be 500000. Determine
    10·1 answer
  • Which of the following hitches are allowed
    8·1 answer
  • Principle states that inventory costs are expensed as cost of goods sold when inventory is sold
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!