### 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.

So we may assume that 'A+' = 4, A = 3.75 etc.

Source Code

#include<stdio.h>
#include<conio.h>
{
float min=0,max=0;
int i;
for(i=0;imax)
{
}
}

for(i=0;i<size;i++)
{
{
}
}
printf("\n");
printf("\n");
}
int main()
{
printf("Enter the size of an Array:\n");
scanf("%f",&size);
return 0;
}
<< Go to Index Page >>

1. #include
#include
#include
{
float min=0,max=0;
int i;
for(i=0;imax)
{
}
}

for(i=0;i<size;i++)
{
{
}
}
printf("\n");
printf("\n");
}
int main()
{
printf("Enter the size of an Array:\n");
scanf("%f",&size);
return 0;
}

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;

}

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;

}

4. #include
using namespace std;

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

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

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];
}

return 0;
}

5. #include
using namespace std;
int main()
{
float temp,s;
int i,j;
cout<<"How many Student: ";
cin>>s;
float a[40];
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];
}

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;
}

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;
}

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;

}

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;

}

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;
}

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

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;
}

13. Summer 2017
ID#201610042

Answer to the Question No. 3:

14. ID : 201620195

15. ID 201610456
MD USUF MIA

16. ID:201520552

17. ID 201610456
MD USUF MIA

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

Robiul islam
Id 201711203
sec A

21. ID-201820298
58 BATCH

#include
using namespace std;

{
float bl[25], min_bl, max_bl;

public:

{
int i;

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

min_bl=max_bl=0;
}

{
int 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];
}

}

{

for (int i=0; i<25; i++)
{
cout<<bl[i]<<" ";
}
cout<<endl;
}
};

int main()
{

obj.min_max();

return 0;
}

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);

}

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);

}

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);

}

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);

}

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 ' };
double value;

value = 4.0;
}
value = 4.0 + 0.3;
}
value = (4.0 - Minus);
}
value = 3.0;
value = (3.0 + Plus);
}
value = (3.0 - Minus);
}
}
value = 2.0;
value = (2.0 + Plus);
}
value = (2.0 - Minus);
}
}
value = 1.0;
value = (1.0 + Plus);
}
value = (1.0 - Minus);
}
}
value = 0.0;
value = (0.0 + Plus);
}
value = (0.0 - Minus);
}
}
cout << "INVALID LETTER GRADE" << endl;
value = 0;
}

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

return 0;
}

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()
{
}

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

#include
using namespace std;

{
public:
float max,min;

{
int i;
float t;
for(i=0; i> ary[i];
}
max = min = ary[0];

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

}

{
int i;
cout << "\nPrint All Grade Number..\n";
for(i=0; i> size;

cout << "Enter The Grades : ";

return 0;
}

29. ID. :201810461
Batch :57th

#include

using namespace std;

class Habib
{
public:
int a;
void getdata()
{
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();

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

using namespace std;

class Habib
{
public:
int a;
void getdata()
{
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;
}

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();

}