Static voidMain47 Average Score (string[] args) { //remove the two highest points, remove the two minimum points, and ask for an average scoreConsole.WriteLine ("Please enter the number of points:"); intA =Convert.ToInt32 (Console.ReadLine ()); int[] fs =New int[A]; if(A <5) {Console.WriteLine ("Enter a score of at least 5! "); } Else { for(inti =0; i < A; i++) {Console.WriteLine ("Please enter the {0} score:", i+1); Fs[i]=Convert.ToInt32 (Console.ReadLine ()); } //Sort for(intj =0; J < FS. Length-1; J + +) { for(intK =0; K < FS. Length-1-J; k++) { if(Fs[k] <= fs[k +1]) { intZJ =Fs[k]; FS[K]= Fs[k +1]; Fs[k+1] =ZJ; } } } //calculate the average score intsum =0; for(intx =0; X < FS. Length; X + +) { if(x = =0|| x = =1|| x = = fs. Length-1|| x = = fs. Length-2) { } Else{sum= Sum +Fs[x]; } } intAVG = sum/(fs. length-4); Console.WriteLine ("the average after removing the two highest and two lowest points is:"+avg); } }
Remove the two highest points, remove the two minimum points, and ask for an average score