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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 22.06.2019 15:20, brookemcelhaney
The north and south regions had very diferent economies in the 1800s.
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, mikey3882
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
image
Computers and Technology, 23.06.2019 01:10, kristofwr3444
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
You know the right answer?
Consider the following two implementations of the same algorithm, each written in a different langua...

Questions in other subjects:

Konu
Mathematics, 25.09.2019 23:00