Iven an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable called avgTemp. Besides temps and avgTemp, you may use only two other variables - - an int variable k and a double variable named total, which have been declared.
k = 0;
total = 0;
while (k < temps. length)
{
total = total + temps[k];
k++;
}
avgTemp = total / (temps. length);
+5
Answers (1)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Iven an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable called ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Home » Computers & Technology » Iven an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable called avgTemp.