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
Sedaia [141]
3 years ago
15

Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine

the number of students not currently standing in their correct positions.Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine the number of students not currently standing in their correct positions.
Mathematics
1 answer:
horrorfan [7]3 years ago
4 0

Answer:

The function in Python is as follows:

def heightChecker(heights):

   expected = []

   count = 0

   for i in range(len(heights)):

       expected.append(heights[i])      

   expected.sort()

   for i in range(len(heights)):

       if expected[i] != heights[i]:

           count+=1  

   return count

Step-by-step explanation:

Required

Function to return the number of out of position students

<em>See comment for complete question</em>

This defines the function. It receives the heights as a parameter, from the main

def heightChecker(heights):

This initializes a list, (expected list)

   expected = []

This initializes the count of out of position students

   count = 0

This iterates through the original list

   for i in range(len(heights)):

The list item is then appended to the expected list

       expected.append(heights[i])      

This sorts the expected list in ascending order

   expected.sort()

This iterates through the original and the expected lists

   for i in range(len(heights)):

If list elements at the same index are not the same, count is incremented by 1

<em>        if expected[i] != heights[i]: </em>

<em>            count+=1  </em>

This returns count

   return count

You might be interested in
hannahs exercise goal is to walk at least 6 1/2 miles this week. she has already walked 2 3/4 miles this week. write and solve a
Ne4ueva [31]

We want to write an inequality that tells how much Hannah should walk this week. The inequality will be:

x ≥ (3 + 3/4) mi

<h3>Finding the inequality:</h3>

We know that she already did walk 2 3/4 miles this week, and she wants to walk at least 6 1/2 miles.

So to reach that minimum, she needs to walk:

(6  1/2)mi - (2 + 3/4) mi = (3 + 3/4) mi

And she can walk that or more, so the inequality is:

x ≥ (3 + 3/4) mi

Where x represents how much she will walk this week.

If you want to learn more about inequalities, you can read:

brainly.com/question/11234618

6 0
2 years ago
Jerome served $725 worth of meals last weekend. How much did Jerome earn last weekend?
Molodets [167]

Answer:

725 dollars probably

Step-by-step explanation:

it really depends on how much is cut away from his check from business expenses and how much his boss would take

7 0
2 years ago
What is the equation of a circle with center at (0, -5) and radius of 7.
timurjin [86]

Answer:

x²+(y-5)²=49

Step-by-step explanation:

3 0
3 years ago
I need help with 23 please!!!
Sever21 [200]

Answer:

28 questions

Step-by-step explanation:

In the first 10 mins she answered 2/5 of 40 which is 16. The remaining amount is 24 questions and half of that is 12. So she answered 12 questions in 15 mins. Finally you add them to get 28 questions in 25 minutes.

3 0
3 years ago
What can you tell about the mean of eachdistribution
erik [133]

Answer:

In a discrete probability distribution of a random variable X, the mean is equal to the sum over every possible value weighted by the probability of that value; that is, it is computed by taking the product of each possible value x of X and its probability p(x), and then adding all these products together, giving. .

Step-by-step explanation:

I really hope this helps have a wonderful day

7 0
3 years ago
Other questions:
  • David bought a 20 ounce bottle of soda. How many quarts of soda are in the bottle?
    13·1 answer
  • Jim Tree will drive from his home in Jackson Heights to Jones City. The distance on the map measures 3 1/2 inches. The scale on
    10·2 answers
  • PLS HELP ME 6, 7, and 8 (SHOW WORK!!) + LOTS OF POINTS + THANKS! + BRAINLIEST IF POSSIBLE!
    5·2 answers
  • Reels produced at 800 per day but production cut by 1/5. They have an order for 20,000 reels. Can they produce enough in 30 days
    15·1 answer
  • Which table accurately describes the points shown on the following graph?
    15·2 answers
  • What is right angle triangle?
    14·1 answer
  • Help me pleaseeee pleaseee
    11·1 answer
  • Simplify.<br><br> 15 – (–3) – 4<br><br> –16<br><br> –8<br><br> 14<br><br> 22
    11·1 answer
  • How many ways can 12 swimmers make it in first, second and third place
    13·2 answers
  • Can anyone give me some insight on this?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!