/*Assignment 2
Group:7
Question:2
G M SHAHEEN SHAH SHIMON (A20EC0266)
MUHAMMAD ARKAN AL RASYID(A20EC0314)*/

#include<iostream>

using namespace std;

int getWinner(char,int);  //function prototype

void displayStatus(int);  //function prototype

int main()
{
	char salesId;
	int salesUnit;
	
	getWinner(salesId,salesUnit);  //function call
	
}	

int getWinner(char salesId,int salesUnit)  //function header
{
	int count;  //to control the amount of input
	int newSales;
	char newId;
	cout<<"\t\t\t\tenter the amount of input= ";
	cin>>count;
	
	while(count>0)
	{
		cout<<"\n\t\t\t\tnenter the salesId= ";
		cin>>salesId;  //the salesID is the uppercase alphabet.For example salesId: 'A'
		
		cout<<"\t\t\t\tenter the salesUnit= ";
		cin>>salesUnit;
		
		if(salesUnit>newSales)
		{
			newSales=salesUnit;
			newId=salesId;
		}
		count--;
	}
	cout<<endl;
	cout<<"\t\t\t\tThe result:"<<endl;
	cout<<"\t\t\t\t"<<newId<<" is the winner and the sales unit= "<<newSales<<endl;
	
	displayStatus(newSales); //function call
}

void displayStatus(int newSales)  //function header
{
	if (newSales>=1000)
			cout<<"\t\t\t\tThe status is excellent"<<endl;
		else if (newSales<1000 && newSales>749)
			cout<<"\t\t\t\tThe status is very good"<<endl;
		else 
			cout<<"\t\t\t\tThe status is good"<<endl;
			
}
