Answer to Question #21350 in C++ for Candice Battle
Input a list of employee names and salaries, and determine the mean (average) salary as well as the number of salaries above and below the mean.
1
2013-01-09T08:16:50-0500
#include <iostream>
using namespace std;
int main()
{
int k=0;
double averege;
int sum=0;
cout << "enter number& employee" << endl;
int n;
cin>>n;
char a[n];
cout << "enter employee names" << endl;
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
& cout << "enter& employee salaries" << endl;
int b[n];
for(int i=1;i<=n;i++)
{
cin>>b[i];
sum= sum+ b[i];
}
& averege=sum/n;
for(int i=1;i<=n;i++)
{
& if(b[i]>=averege)
{
k=k+1;
}
}
cout<<"averege= "<<averege<<endl;
cout<<" number of salaries above and below the mean= " <<k<<endl;
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment