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
PLZ HELP AS FAST.
ivanzaharov [21]

<em>Answer</em>

the <u>triangle on the bottom left</u> has the greatest area

<em>Step-by-step explanation</em>

first one has an area of 24.5

second one has an area of 19.6

the third one has an area of 27.6 (greatest area)

19.6>24.5>27.6

<em>hope this helped!</em>

<em>have an awesome day :D</em>

5 0
2 years ago
Read 2 more answers
At the movie theater, childs admission is $6.10. Adult admission is $9.40. On Tuesday four times as many adult tickets as child
Harlamova29_29 [7]

Answer:

The number of children's tickets sold was 27

Step-by-step explanation:

Let

x ----> the number of children's tickets sold

y ----> the number of adult's tickets sold

we know that

6.10x+9.40y=1,179.90 ----> equation A

y=4x ----> equation B

Solve the system by substitution

Substitute equation B in equation A

6.10x+9.40(4x)=1,179.90

solve for x

6.10x+37.6x=1,179.90

43.7x=1,179.90

x=27

therefore

The number of children's tickets sold was 27

8 0
3 years ago
Find X (30,60,90) need help asap asap
Shtirlitz [24]

Answer:

The correct answer will be X = 4

Step-by-step explanation:

Using Pythagoras

AB^2 + BC^2 = AC^2

2^2 + (2√3)^2 = AC^2

4 + (4*3) = AC^2

4+12 = AC ^ 2

AC ^2 = 16

AC = √16 = 4

3 0
2 years ago
The circumference of a circle is 3 pie inches. What is the area of the circle
sweet [91]

Answer:

A = 28.26

Step-by-step explanation:

Hello!! The area is:

A = 3.14 ( 3 )²

A = 3.14 ( 9 )

A = 28.26

7 0
2 years ago
Why do we need to pay for branily, is suppose to be just answers
Tom [10]

Answer:

I'm pretty sure u dont need too as far as ik theres no premium either

7 0
3 years ago
Read 2 more answers
Other questions:
  • In surveying families with pets, 5 out of 7 families owned a dog. If 35 families had dogs, how many families were surveyed?
    8·1 answer
  • Corinne earns an hourly wage on top of her weekly gas allowance for her delivery job. Her weekly earnings can be shown using the
    12·2 answers
  • How many solutions does the following equation have? 4x+x+3=4x *
    13·1 answer
  • For each part below, give an example of a linear system of
    12·1 answer
  • Birth weights at a local hospital have a Normal distribution with a mean of 110 oz and a standard deviation of 15 oz. The propor
    9·1 answer
  • Which of these statements is true for f(x)=(1/10)^x
    9·2 answers
  • you downloaded a video game to your computer. You have a 60-minute free trial of the game. It takes 5 minutes to set up the game
    8·1 answer
  • Which statement best describes points P and Q?
    5·1 answer
  • What is the difference and similarity of finite and infinite set​
    11·1 answer
  • If the ice shop has only enough cocoa to make 4 gallons of chocolate ice cream, how many gallons of strawberry ice cream can the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!