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]
2 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]2 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
Elsa runs 7 miles in 80 minutes. At the same rate, how many miles would she run in 64 minutes?
charle [14.2K]

Heather runs 7 miles in 80 minutes.

At the same rate, how many miles would she run in 64 minutes?

Let x represent miles would she run in 64 minutes?

Question Sets Up the Proportion

7/80= x/63    |Cross Multiplying to solve for x

     x = 7*64/80

     x = 5.6mi

Hope this helps!

7 0
2 years ago
Round each number to the nearest hundred and estimate the sum. 1,382 + 966
Daniel [21]

Answer:

1,500

Step-by-step explanation:

1,382 + 966

Rounding to the nearest hundred would be:

1,400 + 1000

= 1,500

8 0
2 years ago
PLEASE SOMEONE GOOD AT MATH HELP IM HAVING A MENTAL BREAKDOWN
Alenkinab [10]
Find the hight and the base that might help
5 0
3 years ago
What is 24/5 as a mixed fraction
Shkiper50 [21]
24/5 = (20 + 4)/5 = 20/5 + 4/5 = 4 + 4/5
= 4 4/5
5 0
3 years ago
Two divers are swimming at different depths below sea level. One diver is at -25.5 ft. The other diver is at -40.75 ft. How far
-Dominant- [34]

Answer:

66.25 ft

Step-by-step explanation:

25.5 + 40.75

66.25

They are 66.25 feet away from each other.

Please let me know if I'm wrong!

5 0
3 years ago
Other questions:
  • Which binomial is a factor of 9x2 + 24xy + 16y2?
    9·1 answer
  • A woman bought 70 Cubes<br>of Sugar and Sold 25% of<br>them.<br>How many Cubes is she<br>Left with?​
    11·2 answers
  • If beyonce had 5 single ladies and she multiplied the single ladies by 13 how many single ladies would there be.
    13·2 answers
  • 2.5% of what number is 1.5?
    10·2 answers
  • PLEASE HELP ME
    8·2 answers
  • Can Somebody Please Help Me With This!!
    7·2 answers
  • Pls answer the question with explanation
    15·1 answer
  • If f(x) = 3x^2 – 2 and g(x) = 2x + 4, find (f- g)(x).
    14·1 answer
  • Add -2.25 +2.5<br><br> Plot the first addend and the sum on the number.<br><br><br> Please quick
    5·1 answer
  • During a physics experiment, a class drops a golf
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!