hi i am working on my computer science homework and its due tomorrow. I have most of it done but it is not compiling and its really frustrating, if someone could give me a hand i would appreciate it, here is my code:
Code:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int maximum(double grades[], int n);
/* Given an array of real numbers and the effective
size of the array (i.e. count of the numbers in the
array), this function returns the location of the
highest number in the array */
int minimum(double grades[], int n);
/* Given an array of real numbers and the effective
size of the array (i.e. count of the numbers in the
array), this function returns the location of the
lowest number in the array */
void deleteElement(double grades[], int *n, int loc);
/* Given an array of real numbers, the effective size
of the array and the location of the element to be
deleted, this function deletes that element from the
array by shifting the rest of the elements one
position to the left and decrementing the count by one
*/
double mean(double grades[], int n);
/* Given an array of numbers and the effective size of
the array this function computes and returns the mean
*/
double StandardDeviation(double grades[], int n);
/* Given an array of numbers and the effective size of
the array, this function computes and returns the
standard deviation as described in the previous
section */
int main(void){
int n, loc, sum, i;
double grades[100];
for (i=0; i<100; i=i+1){
printf("Enter first grade: ");
scanf("%f", &n);
grades[i] = n;
}
/*finds the sum of all grades*/
sum=0;
for (i=0; i<=99; i=i+1)
sum=sum + grades[i];
printf("%d", sum);
return 0;
}
/*find minimun grade*/
int minimum(double grades[], int n)
{
int i, j, lowGrade = 100;
for ( i = 0; i < n; i++)
for ( j = 0; j < n; j++)
if (grades[i] < lowGrade)
lowGrade = grades[i];
return lowGrade;
}
/* Find the maximum grade*/
int maximum(double grades[], int n)
{
int i, j, highGrade = 0;
for (i = 0; i < n; i++ )
for ( j = 0; j < n; j++ )
if ( grades[i] > highGrade )
highGrade = grades[j];
return highGrade;
}
/*find the mean*/
double mean(double grades[], int n)
{
int i, total = 0;
for (i = 0; i <= n - 1; i++)
total += grades[i];
return (double) total/n;
}
/*find the standard deviation*/
double StandardDeviation(double grades[], int n)
{ ?}
[code][/code]tagged by Salem