Can someone help me this programme please. The question is:
Write a C program that accepts by keyboard input eight (8) user-ratings of the Galaxy S5. The ratings use a scale of 1 to 10, where 10 represents a high rating and 1 represents a low rating:
1) Prints the lowest and highest rating received for the S5.
2) Calculates and prints the average of the ratings.
3) Determines and prints the average ratings performance as "Excellent" if the average is between 7.5 and 10, "Average" if the average is between 5.5 and 7.4, and "Poor" if the average is between 0 and 5.4.
Code:
#include<stdio.h>
/*Samsung S5 user ratings*/
int main (void) {
int average;
int total;
int rate;
int counter;
int smallest;
int largest;
int i;
counter = 1;
total = 0;
while (counter<=8) {
printf ("Please enter a rate: ");
scanf ("%d",&rate);
total = total + 1;
counter = counter +1;
}
/*Find the largest number*/
largest = rate;
for (i=0; i<8; i++){
if (rate>largest)
largest = rate;
}
printf ("The largest number is:%d\n", largest);
/*Find the smallest number*/
smallest = rate;
for (i=0; i<8; i++){
if (rate<smallest)
smallest = rate;
}
printf ("The smallest number is:%d\n", smallest);
/*Find the average rate for the S5*/
average = rate/8;
printf ("The average is %d\n",&average);
if ((average >= 7.5) || (average >= 10)){
printf ("S5 rate is Excellent");
}
else if ((average >= 5.5) || (average >= 7.4)){
printf ("S5 rate is Average");
}
else if ((average >= 0) || (average >= 5.4)){
printf ("S5 rate is poor");
}
}
That is my prgramme so far but its not compiling correctly.