/* Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer/float grades.  Print the array and print the highest and lowest grades, labeled appropriately. Try to enter all kind of integer/float grades in your array.*/

 

/* Author Name:Md.Naimul Hasan shohan */

 

#include<iostream>

using namespace std;

void find_low_hight_grade(float grades[],int size)

{

   float minimum,maximum;

   for(int i=0;i<size;i++)

   {

       cin>>grades[i];

       if(grades[i]<minimum)

       {

           minimum=grades[i];

       }

           if(grades[i]==4)

           {

               cout<<"A+"<<endl;

           }

 

           else if(grades[i]==3.75)

           {

               cout<<"A"<<endl;

           }

 

           else if(grades[i]==3.50)

           {

               cout<<"A-"<<endl;

           }

 

           else if(grades[i]==3.25)

           {

               cout<<"B+"<<endl;

           }

 

           else if(grades[i]==3.00)

           {

               cout<<"C"<<endl;

           }

 

           else if(grades[i]==2.75)

           {

               cout<<"B-"<<endl;

           }

 

           else if(grades[i]==2.50)

           {

               cout<<"C+"<<endl;

           }

 

           else if(grades[i]==2.25)

           {

               cout<<""<<endl;

           }

 

           else if(grades[i]==2.00)

           {

               cout<<"D"<<endl;

           }

   maximum=grades[0];

   minimum=grades[0];

   }

 

  for(int i=0;i<size;i++)

  {

  if(grades[i]>maximum)

  {

      maximum=grades[i];

  }

 

  for(int i=0;i<size;i++)

  {

      if(grades[i]<minimum)

      {

          minimum=grades[i];

      }

  }

  }

   cout<<"Maximum Grade:"<<maximum<<endl;

   cout<<"Minimum Grade:"<<minimum<<endl;

}

int main()

{

  float grades[25],size;

  cout<<"Enter the size of an array:"<<endl;

  cin>>size;

  cout<<"Enter Grade:"<<endl;

  find_low_hight_grade(grades,size);

}

 

 

 

 
     
  Back to Main Page