help me in solving this..

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2009
Posts: 9
Reputation: kiryoku has a little shameless behaviour in the past 
Solved Threads: 1
kiryoku kiryoku is offline Offline
Newbie Poster

help me in solving this..

 
0
  #1
Oct 25th, 2009
Get the remarks of ten employees on three items...
the remarks is determined by comparing the total sale of an employee to the average of the group..

i've done this already..dont know to add the items...and get its average...
its only the input...
[CODE]#include<iostream>
#include<conio.h>
using namespace std;
int i,n[10],it,item[3];

int main(){

cout<<"Rate the Employee's Performance [1-10].\n";
cout<<"10 is the highest 1 is the lowest.\n";


for(i=1;i<11;i++){
cout<<"\tEmployee no."<<i<<".\n";
for(it=1;it<4;it++){
cout<<"\tItem no."<<it<<":";
cin>>item[it];


}
system("cls");

}


getch();
return 0;
}
[CODE]
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 678
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 101
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster
 
0
  #2
Oct 25th, 2009
Add the 10 totals value to derieve a FULL SALES value, That Sales divided by 10 would give you the Average. What you can do is store the totals in the array, then compute the Average. And then determine...

Btw, Please make sure if your code runs properly. It must be currently crashing .
  1. for(it=1;it<4;it++){
  2. cout<<"\tItem no."<<it<<":";
  3. cin>>item[it];

The array Index starts from 0 to n-1 for any definition of data_type array_name[n]; where n is a constant value .
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 130 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC