suhu[9]=suhu[8];
suhu[8]=suhu[7];
suhu[7]=suhu[6];
suhu[6]=suhu[5];
suhu[5]=suhu[4];
suhu[4]=suhu[3];
suhu[3]=suhu[2];
suhu[2]=suhu[1];
suhu[1]=suhu[0];
suhu[0]=Sensorsuhu;
There's two reason's not to do this. First is it's 'hard coded' and you can't easily change your filter size. Use a for(;
loop. The other reason is that copying all of this data every time you take a reading is 'expensive'. It takes the processor a lot of time to read in a value and write it back out to the main memory. The better way of doing it is to record where you last saved a value and write the next value in the next cell. When you get to the last cell, the next value will be written to position 0.
Then you also have another two problems here:delay(1000); Don't do that. The first problem is that you can't do anything else while you are on delay. This is actually not a big problem for this small demo, but it will be significant if you try to add anything else. The real issue for this program is the other parts of the program don't execute consistently. There's a small variation in the duration of each loop. While delay() has a fixed duration, the sampling frequency will vary just a tiny bit. This means that any filter you design won't work quite like you expect.
Now go and read about FIR and IIR filters. This can be a pretty advanced subject but really you just need to understand the difference between them and why the impulse response curve is a good way to visualise the action of the filters. Can you draw the impulse response of your filter above?
Once you have understood all of the above points, come back here and I'll tell you how to design a filter that will blow your professor's socks off.
For designing FIR filters, I use http://t-filter.engineerjs.com/. This is the absolute best way of designing filters and comparing different options. It lets you see the impulse response and it has lots of other great output options. You can simply copy-paste the code from here into your Arduino program and have an amazingly good filter for any purpose.
The filter-design program is exceptionally good but you do need to understand a little bit about digital signal processing to understand what the limitations are. The chart looks great on the screen but if there's frequency components in your signal outside that chart, you need to know what effect they have.