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
It took you 120 minutes to work 15 math problems. How long did you spend on<br> each problem
Karolina [17]

Answer:

8 minutes

Step-by-step explanation:

120÷ 15= 8

yup thats pretty much it

5 0
2 years ago
Read 2 more answers
There are 4 boys and 2 girls from the seventh grade and 3 boys and 5 girls from the eighth grade on the soccer team. Coach Foste
hodyreva [135]
1/2 because there is 7 girls and 7 boys in total
5 0
3 years ago
The length of a side of an equilateral triangle is 40cm. what is the length of the altitude of the triangle?
podryga [215]

Answer:

20√3 cm

Step-by-step explanation:

Altitude of an equilateral triangle splits it into 2 equal right triangles, it bisects the base and the angle opposite to the base.

<u>Let the altitude be x. Then as per Pythagorean theorem:</u>

  • x² = 40² - (40/2)²
  • x²= 1600 -400
  • x²= 1200
  • x= √1200
  • x= 20√3 cm

<u>Correct choice is</u> the second one

4 0
3 years ago
What is the ratio of 24 to 64 in simplest form?
Yakvenalex [24]
24/64= 3/8
so the ratio is 3 to 8 
6 0
3 years ago
Read 2 more answers
Which graph represents the solution set of this inequality?<br><br> please help!!!
miv72 [106K]

Answer:

C is the correct answer due to two-step inequality process

Step-by-step explanation:

Your inequality is: 5a + 18 < -27

First,  you must remember that the < or > shall not be shaded in.

You could automatically eliminate answer A.

Now you need to do two-step inequalities which is the same thing as two-step equations but with an inequality sign.

5a + 18 < -27

5a < -27-18

5a < -45

**Now, here's something important: If you are multiplying with negatives while dealing with inequalities you must switch the sign to its opposite.

-9 > a

You need to find a number line that has numbers less than -9. It could be -10, -11, -12, -122, etc.

C is the correct answer.

3 0
2 years ago
Other questions:
  • Write the standard form of the line that passes through (-1,-3) and (2,1)
    10·1 answer
  • Is this a function 2y+3x=6
    14·1 answer
  • What is the formula of the area of any triangle
    8·2 answers
  • Can someone please help, im legit confused.
    7·1 answer
  • Need help on 8 please
    6·1 answer
  • Round 0.8 to the nearest thousandth
    14·2 answers
  • How do I solve this?
    5·1 answer
  • The answer i’m on a timer
    15·1 answer
  • Stephen rode his bike 23.4865 miles On monday and 38.243 miles on Tuesday. How many miles did he ride in all
    11·1 answer
  • Use natural logarithms to solve the equation. Round to the nearest thousandth.<br><br> 7e3x − 4 = 14
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!