Consider the following two implementations of the same algorithm, each written in a different language.

 Consider the following two implementations of the same algorithm, each written in a different language.

Language A:Calculate the average daily rainfall for the week (averageRainfall) by adding together the rainfall totals for each of the 7 days of the week (sun, mon, tue, wed, thu, fri, and sat) and dividing the sum by 7.

Language B:Take the total amount of rain from each day of the week (sunday, monday, tuesday, wednesday, thursday, friday and saturday) and then average them together to get the average daily rainfall for the week (averageRainfall).

Which of the following statements about these two implementations is true?

  • Language B is ambiguous because the process of "average" is not explained well



Answers First: Get answers or Ask questions on subjects like Education, Technology, Social, LifeStyle and more.




  • Please comment if you find a different answer.


Related Posts

Post a Comment