subject

There are 32 students standing in a classroom. Two different algorithms are given for finding the average height of the students.
Algorithm A
Step 1: All students stand.
Step 2: A randomly selected student writes his or her height on a card and is seated.
Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased.
Step 4: Repeat step 3 until no students remain standing.
Step 5: The sum on the card is divided by 32. The result is given to the teacher.
Algorithm B
Step 1: All students stand.
Step 2: Each student is given a card. Each student writes his or her height on the card.
Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student’s card; the other student is seated. Theprevious value on the card is erased.
Step 4: Repeat step 3 until one student remains standing.
Step 5: The sum on the last student’s card is divided by 32. The result is given to the teacher.
Which of the following statements is true?
(A) Algorithm A always calculates the correct average, but Algorithm B does not.
(B) Algorithm B always calculates the correct average, but Algorithm A does not.
(C) Both Algorithm A and Algorithm B always calculate the correct average.
(D) Neither Algorithm A nor Algorithm B calculates the correct average.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 07:50
Write a defining table and then a program that determines if you can sleep in or not. your program should get all its input from your computer’s clock. on all weekdays (monday through friday) that are not holidays, your program should output “get up! ” on all other days (weekends and holidays), your program should output “sleep in.” the three holidays that your program must check for are january 1 (new year’s day), july 4 (u.s. independence day), and december 25 (christmas). you don’t need to include other holidays in your program because most other holidays do not occur on a fixed day each year.
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
What function key is used to enable the spelling and grammar function
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
What does a trademark indicate about a product? a trademark is a sign, symbol, or short phrase that indicates the of a product or service. type the correct answer in the box
Answers: 1
You know the right answer?
There are 32 students standing in a classroom. Two different algorithms are given for finding the a...
Questions
question
English, 20.04.2021 17:40
question
Mathematics, 20.04.2021 17:40
question
Mathematics, 20.04.2021 17:40
question
Mathematics, 20.04.2021 17:40
question
Mathematics, 20.04.2021 17:40
question
Engineering, 20.04.2021 17:50
question
Spanish, 20.04.2021 17:50
Questions on the website: 13722366