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, 21.06.2019 12:30
Amanager suspects that one of his team members has been fraudulently accessing confidential and sensitive information and breaching data integrity. which technology would the manager look into the activities of the team member? technology would be useful to look into the activities of the team member.
Answers: 3
question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
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, 06.10.2019 06:30
question
Mathematics, 06.10.2019 06:30