Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please use program C I\'m studying tempertures over various time scales. Unfortu

ID: 2249087 • Letter: P

Question

Please use program C

I'm studying tempertures over various time scales. Unfortunately, my thermometer isn't very precise, so I need to average its readings together to level out the spikes.

I need you to write a program to generate a running average of my temperture data. The first (integer) input is the number of data points (guaranteed to be less than 1000). The next (integer) is the number of data points to be averaging together. The rest of the input are whitespace separated floats. Please output the running average with one point of precision, each on their own line.

Example Input

10 4

27.9 31.7 29.56 35.7 38.5 41.6 50.6 48.6 55.7 60.4

Correct Output:

31.2

33.9

36.3

41.6

44.8

49.1

53.8

Explanation / Answer

#include int main () { int n; int avg_pt; int x; float temp [1000]; int i,j; double sum=0; scanf("%d %d",&n,&avg_pt); x=avg_pt; for(i=0;i