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 recently purchased a stock that is expected to earn 30 percent in a booming economy, 9 percent in a normal economy, and lose
sergiy2304 [10]
Took me a bit to understand what this is. I have no business sense at all.

Expected Rate of Return = 30%*5% + 9%*75% - 33% * (100 - 75 -5)%
Expected Rate of Return = 0.015 + 0.0675 - 33%*20%
Expected Rate of Return = 0.015 + 0.0675 - 0.066
Expected Rate of Return = 0.0165

This then is expressed as a %
0.0165 = 1.65 % Sounds like you are buying a US short term treasury.
If anyone else answers, take their answer.
 
3 0
3 years ago
Units Unit Cost Inventory, Jan. 1 8,000 $11 Purchase, June 19 13,000 12 Purchase, Nov. 8 5,000 13 If 9,000 units are on hand at
Lostsunrise [7]

Answer:

The answer is: $100,000

Explanation:

Under LIFO (last in, first out) costing method, we use the oldest costs are used to determine the ending inventory:

We were given the following data:

  • Jan. 1: 8,000 purchased at $11 per unit
  • June 19: 13,000 purchased at $12 per unit
  • Nov. 8: 5,000 purchased at $13 per unit

If the ending inventory had 9,000 units, then its total cost is:

Ending inventory = (8,000 units x $11 per unit) + (1,000 units x $12 per unit)

Ending inventory = $88,000 + $12,000 = $100,000

3 0
3 years ago
Nicoloss is a store that sells clothes, cosmetics, travel bags, and furniture to final consumers. Customer reviews indicate that
kirill115 [55]

Answer: Department store

Explanation: When an establishment offers products and services to end or final consumers in various product segments or categories, such stores are usually referred to as department stores. The word department means each product offering is separated or segmented with varieties to choose from. In the scenario above, Nicoloss store is composed of departments ranging from Clothing, Cosmetics, travel bags, furniture, which gives shoppers the opportunity to purchase from different categories of products on offer within the walls of a single store.

6 0
3 years ago
If Sally deposits $1200 per year and the account earns interest at a rate of 4% per year, compounded annually, how much will she
Alex787 [66]

Answer:

$88,382.67

Explanation:

Here is the complete question:

Sally makes deposits into a retirement account every year from the age of 30 until she retires at age 65.If Sally deposits $1200 per year and the account earns interest at a rate of 4% per year, compounded annually, how much will she have in the account when she retires?

To calculate the future value of the annuity, we use this formula: amount x annuity factor

Annuity factor = {[(1+r) ^N ] - 1} / r

Amount = $1200

R = interest rate = 4%

N = number of years = 35

=( 1.04^35 - 1) / 0.04 = 73.652225

73.652225 × $1200 = $88,382.67

I hope my answer helps you

8 0
4 years ago
Identify a brand and discuss how the organization is blending marketing mix element to achieve a marketing communication objecti
NeX [460]

Answer:

Nike as a brand is making the use of Marketing mix to communicate a objective of high quality sport brand.

Explanation:

  • The aim of the marketing mix s the right combination of product, place, promotion, and price, etc. It is done so that the company can have an advantage over the competitors. It's a set of controllable and tactile marketing tools.
8 0
3 years ago
Other questions:
  • Assume you earned 12.3 percent on your investments for a time period when the risk-free rate is 4.25 percent and the inflation r
    8·1 answer
  • If you pay the balance on your credit card each month, the _____ is the most important factor to consider when selecting a credi
    8·1 answer
  • When asked about the possible motive for a homicide,an innocent person would most likely
    12·1 answer
  • A year end review of Accounts Receivable and estimated uncollectible percentages revealed the​ following: Days Outstanding Accou
    10·1 answer
  • A firm has common stock with a market price of $25 per share and an expected dividend of $2 per share at the end of the coming y
    15·1 answer
  • Mirr, Inc. was incorporated on January 1, year 1, with proceeds from the issuance of $750,000 in stock and borrowed funds of $11
    7·1 answer
  • PLZ ANSWER!!!! 10 POINTS GIVEN 20 POINTS SPENT!!!
    13·1 answer
  • Proofread the sentence below. Look for up to three errors in grammar, punctuation, capitalization, the use of numbers, and busin
    8·1 answer
  • Identify each statement as either true or false. In the United States, banks keep the entire value of all customer deposits in t
    11·1 answer
  • oronado Company has the following account balances: Purchases $95600 Sales Returns and Allowances 12600 Purchase Discounts 8300
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!