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
Help me please!!! And thank you!!!!
katen-ka-za [31]
<h2>Answer:</h2>

The last answer - 9x squared y squared

<h2></h2>

8 0
2 years ago
Write as a product of two polynomials. <br><br> (x-y)^2-a(y-x)
Setler79 [48]

Answer:

\sf{(x-y)^2-a(y-x)} \\ = \sf{({x}^{2}  - 2xy +  {y}^{2} ) - (ay - ax)} \\

7 0
2 years ago
Read 2 more answers
1)bir üçgenin kenar uzunlukları 2,3ve4 ile ters orantılıdır.üçgenin çevresi 39 cm olduğuna göre en uzun kenarı kaç cmdir?
goldenfox [79]
1. 
The edge lengths of a triangle are inversely proportional to 2,3 and 4.
The actual proportions of the lengths are then
12(1/2:1/3:1/4)=6:4:3
The longest side 
= 39* (6/(6+4+3)
= 39*6/13
=18

2. 63 breads : 35 kg flour
is the same as 
54 breads : x kg flour
Cross multiply and get
x=54*35/63=30
30 kg of flour are needed to make 54 breads.
3 0
3 years ago
Marilyn uses a credit card with a 19.9% APR compounded monthly to pay for car repairs totaling $991.38. She can pay $410 per mon
Leokris [45]
Marilyn's finance charge at the end of the first month will be
  $991.38 × 0.199/12 = $16.44
The balance subject to the next month's finance charge will be
  $991.38 +16.44 -410.00 = $597.82

The finance charge at the end of the second month will be
  $597.82 × 0.199/12 = $9.91
The balance remaining after the second payment will be
  $597.82 +9.91 -410.00 = $197.73

The finance charge applied at the end of the third month is
  $197.73 × .199/12 = $3.28
so Marilyn can make one final payment of
  $197.73 +3.28 = $201.01
to pay off the balance.

In all, Marilyn has paid 2×$410.00 +201.01 = 
  $1021.01 . . . . . . . . corresponds to the first choice

_____
In real life, Marilyn's credit card may not accrue any finance charge until after the first statement on which the charge appears. Thus the total cost of the purchase may be only $1004.02. The attached spreadsheet shows the beginning balance and the finance charges for each month for the two different scenarios.

8 0
3 years ago
hayden bought 48 new trading cards three fourths of the new cards are baseball cards how many baseball cards did hayden buy
satela [25.4K]
He bought 36 baseball cards. Since 3/4 of the 48 cards are baseball cards, you need to find 75% of 48, which is 75*48, which is 36 cards. Hope this helps. 
8 0
3 years ago
Read 2 more answers
Other questions:
  • Solve for n<br> 2n+3= -3.2
    5·2 answers
  • Can you please solve a it is so important
    5·1 answer
  • Plz help I'm stuck on this one
    7·2 answers
  • For what value of x does m 1=90°?
    11·1 answer
  • A snorkeling mask is priced at
    15·2 answers
  • Can you help me on this?
    9·2 answers
  • 1) Suzanne will pay $14 to get her hair cut. She wants to leave the hairdresser a 15% tip. What is the total cost of the haircut
    11·1 answer
  • Point A is located in which quadrant?<br> On a coordinate plane, point A is at (negative 3, 5).
    5·1 answer
  • What is the length of AB?
    13·2 answers
  • 3/5 pound of pasta feeds 6 people how many lbs does each person get
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!