0
beyler finale giriyorum , soruyu yazıcam birazdan yardım edin lan .(
asoran.etu.edu.tr/sinav.rar beyler bu acil
2 soru var beyler
const int num_grades = 10;
const int num_sudents = 3;
int findhighest( int );
int findlowest( int * );
void printdatabase( const int [][], const char [][ 20 ] );
int main()
{
int student1[ num_grades ] = { 0 };
int student2[ num_grades ] = { 76, 89, 81, 42, 66, 93, 104,
91, 71, 105 };
int student3[ num_grades ] = { 65, 69, 91, 89, 82, 93, 72,
76, 79, 99 };
char names[ num_sudents ][ 20 ] = { "bob", "john", "joe" };
int database[ num_sudents ][ num_grades ];
int i = 0;
srand( time( 0 ) );
// initialize student1
for ( i = 0; i < num_grades; i++ )
student1[ num_grades ] = rand() % 50 + 50;
// initialize database
for ( i = 1; i < num_grades; i++ ) {
database[ 0 ][ i ] = student1[ i ];
database[ 1 ][ i ] = student2[ i ];
database[ 2 ][ i ] = student3[ i ];
} // end for
printdatabase( database, studentnames );
for ( i = 0; i < num_sudents; i++ ) {
cout << studentnames[ i ] << "'s highest grade is: "
<< findhighest( student1 ) << endl
<< studentnames[ i ] << "'s lowest grade is: "
<< findlowest( database[ i ] ) << endl;
} // end for
return 0;
} // end main
// determine largest grade
int findhighest( int )
{
int highest = a[ 0 ];
for ( int i = 1; i <= num_grades; i++ )
if ( a[ i ] > highest )
highest = a[ i ];
return highest;
} // end function findhighest
// determine lowest grade
int findlowest( int a[] )
{
int lowest = a[ 0 ];
for ( int i = 1; i < num_grades; i++ )
if ( a[ i ] < lowest )
lowest = a[ i ];
return lowest;
} // end lowestgrade
// output data
void printdatabase( int a[][ num_grades ], char names[][ 20 ] )
{
cout << "here is the grade databasenn"
<< setw( 10 ) << "name";
for ( int n = 1; n <= num_grades; n++ )
cout << setw( 4 ) << n;
cout << endl;
for ( int i = 0; i < num_sudents; i++ ) {
cout << setw( 10 ) << names[ i ];
for ( int j = 0; j < num_grades; j++ )
cout << setw( 4 ) << a[ i, j ];
cout << endl;
} // end for
cout << endl;
} // end printdatabase
hataları bulcaz beyler 2. soru bu düzeltçez tabi hadi lan