Computers and Technology, 07.06.2021 03:00 shantrice1831
A programmer for a weather website needs to display the proportion of days with freezing temperatures in a given month.
Their algorithm will operate on a list of temperatures for each day in the month. It must keep track of how many temperatures are below or equal to 32. Once it's done processing the list, it must display the ratio of freezing days over total days.
Which of these correctly expresses that algorithm in pseudocode?
A.
numFreezing ← 0
numDays ← 0
FOR EACH temp IN temps {
IF (temp ≤ 32) {
numFreezing ← numFreezing + 1
}
numDays ← numDays + 1
DISPLAY(numFreezing/numDays)
}
B.
numFreezing ← 0
numDays ← 0
FOR EACH temp IN temps {
IF (temp ≤ 32) {
numFreezing ← numFreezing + 1
}
numDays ← numDays + 1
}
DISPLAY(numFreezing/numDays)
C.
numFreezing ← 0
numDays ← 0
FOR EACH temp IN temps {
IF (temp < 32) {
numFreezing ← numFreezing + 1
}
numDays ← numDays + 1
}
DISPLAY(numFreezing/numDays)
D.
numFreezing ← 0
numDays ← 0
FOR EACH temp IN temps {
IF (temp ≤ 32) {
numFreezing ← numFreezing + 1
numDays ← numDays + 1
}
}
DISPLAY(numFreezing/numDays)
Answers: 3
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
Computers and Technology, 23.06.2019 22:20
Learning sign language is an example of a(n) learning sign language is an example of a(n)
Answers: 2
Computers and Technology, 23.06.2019 23:00
Computer programming is one type of what career
Answers: 1
A programmer for a weather website needs to display the proportion of days with freezing temperature...
Mathematics, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Chemistry, 13.01.2021 20:20
Geography, 13.01.2021 20:20
Computers and Technology, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20
Health, 13.01.2021 20:20
Mathematics, 13.01.2021 20:20