subject

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?
1. Language A is ambiguous because it is unclear what sun, mom, tue, wed, thu, fri, and sat refer to in context with the problem.
2. The algorithms in both languages are ambiguous because they do not specify the actual values of the seven daily rainfall totals.
3. Language B is ambiguous because the process of "average" is not explained well enough for someone to computationally be able to solve the problem.
4. Neither of these languages is clear enough that a programmer could write a correct solution in a high-level programming language.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
You know the right answer?
Consider the following two implementations of the same algorithm, each written in a different langua...
Questions
question
Mathematics, 07.12.2021 01:50
question
Spanish, 07.12.2021 01:50
Questions on the website: 13722360