create a menu driven application that accepts the salaries for ten employees and display the following information:
1)max salary
2)min salary
3)avg salary
4)number of employees whos salary is greater than 1000
5)the salaries in ascending and descending orders.
#include <iostream>
using namespace std;
class Max
{
int marks[10];
public:
void max()
{
int m;
for(m=0; m<10; m++)
{
cout<<"enter marks"<<endl;
cin>>marks[m];
}
int com=0;
while(com<9)
{
int temp;
if(marks[com] < marks[com+1] )
{
temp=marks[com];
marks[com]=marks[com+1];
marks[com+1]=temp;
com=0;
continue;
}
com++;
}
}
void disp()
{
int com=0;
cout<<marks[com]<<"is the max number"<<endl;
}
};
int main()
{
Max A;
A.max();
A.disp();
return 0;
}
i wrote this code which would accept values and store them in array and check for max number but i am not able to make it check for minimum number and the rest. i tried creating another method but it isn't working. :(