//This program calculte the average, highest and lowest inputed temperature
//fathi mohamed fathi rezq bekhit
#include <iostream>
#include <iomanip>
using namespace std;

float average(float[],int);
void highest(float[],int);
void lowest(float[] ,int);

int main()
{
	int num_temp;
	cout<<"Please enter the number of temperatures to be read"<<endl;
	cin>>num_temp;
	float temperature[num_temp];
	for(int count=0;count<num_temp;count++)  {
	cout<<"entered temperature "<<count+1<<" :"<<endl;
	cin>>temperature[count];
	}
	cout<<fixed<<setprecision(2)<<showpoint<<endl;
	cout<<"average temperature is "<<average(temperature,num_temp)<<endl;
	highest(temperature,num_temp);
	lowest(temperature,num_temp);
	return 0;
}
float average(float tempe[],int size)  {
	float sum=0;
	for(int count=0;count<size;count++) 	{
	sum+=tempe[count];
	}
	return (sum/size);
}
void highest(float tempe[],int size) {
	float highest;
	int count=0;
	highest=tempe[count];
	for(;count<size;count++)	{
	
	if(highest<tempe[count])	{
	highest=tempe[count];
	}
		
	}
	cout<<"highest temperature is "<<highest<<endl;
}
void lowest(float tempe[],int size) {
	
	float lowest;
	int count=0;
	lowest=tempe[count];
	for(;count<size;count++)
	{
		
		
	if(lowest>tempe[count]) 	{
	lowest=tempe[count];
	}
		
	}
		cout<<" lowest temperature is "<<lowest<<endl;
}
