Index-1              Index-2              Home Page

Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades. Print the array and print the highest and lowest grades, labeled appropriately

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

Hits of integer grades:

A+ is a Letter Grade.
A is  a Letter Grade.
4 is an Integer Grade.
3.75 is an Integer Grade.
So we may assume that 'A+' = 4, A = 3.75 etc.

Source Code

#include<stdio.h>
#include<conio.h>
void grade(float grades[],int size)
{
float min=0,max=0;
int i;
for(i=0;imax)
{
max=grades[i];
}
}

for(i=0;i<size;i++)
{
if(grades[i]<min)
{
min=grades[i];
}
}
printf("\n");
printf("Maximum Grade: %.2f",max);
printf("\n");
printf("Minimum Grade: %.2f",min);
}
int main()
{
float grades[25],size;
printf("Enter the size of an Array:\n");
scanf("%f",&size);
printf("Enter the Grade point:\n");
grade(grades,size);
return 0;
}
<< Go to Index Page >>

31 comments:

  1. #include
    #include
    #include
    void grade(float grades[],int size)
    {
    float min=0,max=0;
    int i;
    for(i=0;imax)
    {
    max=grades[i];
    }
    }

    for(i=0;i<size;i++)
    {
    if(grades[i]<min)
    {
    min=grades[i];
    }
    }
    printf("\n");
    printf("Maximum Grade: %.2f",max);
    printf("\n");
    printf("Minimum Grade: %.2f",min);
    }
    int main()
    {
    float grades[25],size;
    printf("Enter the size of an Array:\n");
    scanf("%f",&size);
    printf("Enter the Grade point:\n");
    grade(grades,size);
    return 0;
    }

    ReplyDelete
  2. using C++
    #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --: \n";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }

    cout << "\n" << "The minimum value is --: " << arr[0] << "\n";
    cout << "\n" << "The maximum value is --: " << arr[4] << "\n";

    return 0;

    }

    ReplyDelete
  3. using C++
    #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --: \n";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }

    cout << "\n" << "The minimum value is --: " << arr[0] << "\n";
    cout << "\n" << "The maximum value is --: " << arr[4] << "\n";

    return 0;

    }

    ReplyDelete
  4. #include
    using namespace std;

    int main(){
    float arr[20], value, temp;
    int period,i,j;

    cout<<"How many students : ";
    cin>>period;

    cout<<"Enter the grades : ";
    for(i=0; i>arr[i];
    }

    for(i=0; iarr[j+1]){
    temp=arr[j];
    arr[j]=arr[j+1];
    arr[j+1]=temp;

    }
    }
    }

    for(i=0; i<period; i++){
    cout<<arr[i];
    }

    cout<<endl<<"maximum grade is: "<<arr[period-1];
    cout<<endl<<"minimum grade is: "<<arr[0];


    return 0;
    }

    ReplyDelete
  5. #include
    using namespace std;
    int main()
    {
    float temp,s;
    int i,j;
    cout<<"How many Student: ";
    cin>>s;
    float a[40];
    cout<<"Input"<< s <<"students grade: ";
    for(i=0; i>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }


    cout<<a[40-1]<<endl;
    cout<<a[0];
    }

    ReplyDelete
  6. Appel mahmud akib. Id:201510384


    #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    ReplyDelete
  7. #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<<"Input"<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    ReplyDelete
  8. #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --:";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }


    return 0;

    }

    ReplyDelete
  9. Using C++
    Mamun ID 149
    #include

    using namespace std;

    int main()
    {
    int arr[25], i,j,p;
    for(i = 0; i < 5; i++){
    cout << "Enter your deserve number : " << " data --: ";
    cin >> arr[i];
    }

    cout < arr[j+1]){
    p = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = p;
    }
    }
    }
    cout <<endl;

    cout << "Array in sorted bellow --:"<<endl;

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout <<endl;
    }


    return 0;

    }

    ReplyDelete
  10. using c++

    #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<<"Input"<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    ReplyDelete
  11. #include
    using namespace std;

    int main()
    {
    int arr[25],i,j,temp;

    for(i=0; i<5; i++){
    cout <<"Enter "<>arr[i];
    }
    for(j=0; j<4; j++){
    for(i=0; i<4; i++){
    if (arr[i]>arr[j+1]){
    temp=arr[i];
    arr[i]=arr[j+1];
    arr[j+1]=temp;
    }
    }
    }
    cout <<"Array in sorted bellow: "<< endl;

    for(i=0; i<5; i++){
    cout <<"Data "<< i+1<< " is: "<<arr[i]<< endl;

    }
    cout <<"The minimum value is: "<<arr[0]<<"\n";
    cout <<"The maximum value is: "<<arr[4];

    return 0;
    }
    id:201510992

    ReplyDelete
  12. // biggest and smallest number

    #include

    using namespace std;

    int main ()
    {

    int values[ 20 ];
    int small,big;
    for ( int i = 0; i < 20; i++ )
    {
    cout << "Enter value " << i << ": ";
    cin >> values[i];
    }
    for (int i = 0; i < 20; i++)
    {
    if(values[i]>big)
    {
    big=values[i];
    }
    if(values[i]<small)
    {
    small=values[i];
    }
    }
    cout << "The biggest number is " << big << endl;
    cout << "The smallest number is " << small << endl;
    }

    ReplyDelete
  13. Summer 2017
    ID#201610042

    Answer to the Question No. 3:
    https://drive.google.com/file/d/0B99eePh0LV8gRHBuRkk2YjkwT28/view?usp=drivesdk

    ReplyDelete
  14. ID : 201620195
    https://drive.google.com/open?id=0B9K31ospCyFjZXROSWtYMDdrQ0k

    ReplyDelete
  15. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2cXZ2bjBnMTJNTFE

    ReplyDelete
  16. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKdWR6ckJTbUtQdVE

    ReplyDelete
  17. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2cXZ2bjBnMTJNTFE

    ReplyDelete
  18. https://drive.google.com/open?id=0Byxq3aat_mNSeTRTY1JzZFJLUlU

    ReplyDelete
  19. https://www.dropbox.com/s/7x0km7ftcdvp2tj/maximum.cpp?dl=0

    Robiul islam
    Id 201711203
    sec A

    ReplyDelete
  20. https://drive.google.com/open?id=0B2Kd5YiufNdVdmI4VFE5c3p4Sm8

    ReplyDelete
  21. ID-201820298
    58 BATCH

    #include
    using namespace std;

    class Grade
    {
    float bl[25], min_bl, max_bl;

    public:

    Grade()
    {
    int i;

    for (i=0; i<25; i++)
    bl[i]=0.0;

    min_bl=max_bl=0;
    }

    void grade_input(void)
    {
    int i;
    cout<<"Enter 25 integer grades:"<>bl[i];
    }

    void min_max()
    {
    int i;
    min_bl=max_bl=bl[0];
    for (i=1; i<25; i++)
    {
    if (min_25>bl[i])
    min_bl=bl[i];
    else if (max_bl<bl[i])
    max_bl=bl[i];
    }

    }

    void print_grades()
    {
    cout<<"List of integer grades:"<<endl;

    for (int i=0; i<25; i++)
    {
    cout<<bl[i]<<" ";
    }
    cout<<endl;
    cout<<"Maximum Grade= "<<max_bl<<endl;
    cout<<"Minimum Grade= "<<min_bl<<endl;
    }
    };

    int main()
    {
    Grade obj;

    obj.grade_input();
    obj.min_max();
    obj.print_grades();

    return 0;
    }

    ReplyDelete
  22. #include
    void main()
    {
    float marks[25],sum=0,avg=0,low,hig;
    int i;
    for(i=0;i<25;i++)
    {
    printf("\n Enter Students marks");
    scanf("%f",&marks[i]);
    if(higmarks[i])
    {
    low=marks[i];
    marks[i]=low;
    }
    sum=sum+marks[i];
    avg=sum/25;
    }
    printf("\n The hihest mark is %0.2f",hig);
    printf("\n The lowest mark is %0.2f",low);
    printf("\n The Average marks is %0.2f",avg);

    }

    ReplyDelete
  23. #include
    void main()
    {
    float marks[25],sum=0,avg=0,low,hig;
    int i;
    for(i=0;i<25;i++)
    {
    printf("\n Enter Students marks");
    scanf("%f",&marks[i]);
    if(higmarks[i])
    {
    low=marks[i];
    marks[i]=low;
    }
    sum=sum+marks[i];
    avg=sum/25;
    }
    printf("\n The hihest mark is %0.2f",hig);
    printf("\n The lowest mark is %0.2f",low);
    printf("\n The Average marks is %0.2f",avg);

    }

    ReplyDelete
  24. #include
    void main()
    {
    float marks[25],sum=0,avg=0,low,hig;
    int i;
    for(i=0;i<25;i++)
    {
    printf("\n Enter Students marks");
    scanf("%f",&marks[i]);
    if(higmarks[i])
    {
    low=marks[i];
    marks[i]=low;
    }
    sum=sum+marks[i];
    avg=sum/25;
    }
    printf("\n The hihest mark is %0.2f",hig);
    printf("\n The lowest mark is %0.2f",low);
    printf("\n The Average marks is %0.2f",avg);

    }

    ReplyDelete
  25. Name- Md.Shariat-ullah
    ID No- 201811211

    #include
    void main()
    {
    float marks[20],sum=0,avg=0,low=0,hig = 0;
    inti;
    printf("\n Enter Students marks");
    scanf("%f",&marks[0]);
    low = marks[0];
    hig = marks[0];
    for(i=1;i<20;i++)
    {
    printf("\n Enter Students marks");
    scanf("%f",&marks[i]);
    if(higmarks[i])
    {
    low=marks[i];
    }
    sum=sum+marks[i];
    }
    avg=sum/20;
    printf("\n The hihest mark is %0.2f",hig);
    printf("\n The lowest mark is %0.2f",low);
    printf("\n The Average marks is %0.2f",avg);

    }

    ReplyDelete
  26. Id: 201820244
    Batch:58th
    section: B


    #include
    using namespace std;
    int main(){

    int plus, minus,value;
    char arr [26] ={' A, B, C, D, F, a, b, c, f ' };
    char grade;
    double value;

    cout << "Enter your letter grade: ";
    cin >> grade;



    if ((grade == 'A' || grade == 'a')){
    value = 4.0;
    }
    else if ((grade == 'A+') || (grade == 'a+')){
    value = 4.0 + 0.3;
    }
    else if (grade == 'A-' || grade == 'a-'){
    value = (4.0 - Minus);
    }
    else if (grade == 'B' || grade == 'b'){
    value = 3.0;
    if (grade == 'B+' || grade == 'b+'){
    value = (3.0 + Plus);
    }
    else if (grade == 'B-' || grade == 'b-'){
    value = (3.0 - Minus);
    }
    }
    else if (grade == 'C' || grade == 'c'){
    value = 2.0;
    if (grade == 'C+' || grade == 'c+'){
    value = (2.0 + Plus);
    }
    else if (grade == 'C-' || grade == 'c-'){
    value = (2.0 - Minus);
    }
    }
    else if (grade == 'D' || grade == 'd'){
    value = 1.0;
    if (grade == 'D+' || grade == 'd+'){
    value = (1.0 + Plus);
    }
    else if (grade == 'D-' || grade == 'd-'){
    value = (1.0 - Minus);
    }
    }
    else if (grade == 'F' || grade == 'f'){
    value = 0.0;
    if (grade == 'F+' || grade == 'f+'){
    value = (0.0 + Plus);
    }
    else if (grade == 'F-' || grade == 'f-'){
    value = (0.0 - Minus);
    }
    }
    else if (!(grade == list[26])){
    cout << "INVALID LETTER GRADE" << endl;
    value = 0;
    }

    cout << "Grade value is [" << value << "]" << endl;


    return 0;
    }

    ReplyDelete
  27. ID#201830546

    #include
    using namespace std;
    class student
    {
    float temp,s;
    int a,i,j;
    int calculate()
    {
    cout<<"How many Student: ";
    cin>>s;
    float a[40];
    cout<<"Input"<< s <<"grade of student : ";
    for(i=0; i>a;i++)
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    };

    int main()
    {
    student grade;
    grade.calculate;
    }

    ReplyDelete
  28. Name : Firoj Ahmed
    ID : 201820222
    Batch : 58th

    #include
    using namespace std;

    class gread
    {
    public:
    float max,min;

    void greadin(float ary[],int size)
    {
    int i;
    float t;
    for(i=0; i> ary[i];
    }
    max = min = ary[0];

    for(i=1; iary[i])
    {
    min = ary[i];
    }
    }

    }

    void greadout(float ary[],int size)
    {
    int i;
    cout << "\nPrint All Grade Number..\n";
    for(i=0; i> size;
    float grades[size];

    cout << "Enter The Grades : ";

    my_gread.greadin(grades,size);
    my_gread.greadout(grades,size);

    return 0;
    }

    ReplyDelete
  29. ID. :201810461
    Batch :57th
    //highest number using overloading//

    #include

    using namespace std;

    class Habib
    {
    public:
    int a;
    void getdata()
    {
    cout<<"Please enter one number:";
    cin>>a;
    }
    };
    class B:public Habib
    {
    public:
    Habib():cout(5){}
    void operator ++()
    {
    count = count+1;
    }
    void display(){ cout<<"count: "<<count;}
    };
    int main()
    {
    Test t;
    ++t;
    t.display();

    ReplyDelete
  30. ID. :201810461
    Batch :57th
    //highest number using inheritance//
    #include

    using namespace std;

    class Habib
    {
    public:
    int a;
    void getdata()
    {
    cout<<"Please enter one number:";
    cin>>a;
    }
    };
    class B:public Habib
    {
    public:
    Habib():cout(5){}
    void operator ++()
    {
    count = count+1;
    }
    void display(){ cout<<"count:;}
    };
    int main()
    {
    Test t;
    ++t;
    t.display();
    return 0;
    }


    ReplyDelete
  31. ID : 201630992

    #include
    using namespace std;

    class number
    {
    public:
    int arr[100];
    int mex=0,mai=0;
    int n,i;


    number()
    {
    cout<<"Enter how many number: ";
    cin>>n;

    for(i=0;i>arr[i];
    }

    }
    ~number()
    {

    }
    void display()
    {
    mex = arr[0];

    for(i=0;iarr[i])
    {
    mai = arr[i];
    }
    }
    cout<<"Enter minimum number: "<<mai;
    }


    };

    int main()
    {
    number obj;

    obj.display();
    obj.display1();


    }

    ReplyDelete