66 994
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #21350 in C++ for Candice Battle

Question #21350
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.
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions