ASSIGNMENT 2 CONTROLL STRUCTURE AND FUNCTION
//ASSIGNMENT___2
//GROUP:_____ 2
//QUESTION____2
//FENG YIYANG (A20EC4020)
//SHAH SAJID (A20EC4050)
//KAZI OMEIR MUSTAFA KAMAL UDDIN (A20EC9104)
#include <iostream>
#include<cstring>
using namespace std;
void displayStatus(int);
int main(){
int id,unit,win_id,stop;
int most_unit=0;
int winner_id=1;
stop=1;
while(stop!=0)
{
cout<<"enter the id of the salesperson: ";
cin>>id;
cout<<"enter the number of units: ";
cin>>unit;
if (unit>most_unit){
most_unit=unit;
winner_id=id;
}
displayStatus(unit);
cout<<"\ncontinue input enter 1 for yes, 0 for no: ";
cin>>stop;}
cout<<"winner's id "<<winner_id;
return 0;
}
void displayStatus(int unit){
if (unit>1000)
{cout<<"excellent"<<endl;
}
else if(unit>749){
cout<<"very good"<<endl;
}
else
cout<<"good"<<endl;
}