#include <iostream>
using namespace std;
double sqftTosqmetre(double dis);
double sqmetresToacres(double dis);
double minimum(double x, double y);
double maximum(double x, double y);
int main()
{
double sqmetre , acres, sqfeet, x1;
double tot=0, tot1=0, min=0, max=0 ;
cout << "Enter area in sq. feet (-999 to stop) : ";
cin >> sqfeet;
if (sqfeet != (-999))
min = sqfeet;
while (sqfeet != (-999))
{
x1 = sqfeet;
tot = tot + sqfeet;
sqmetre = sqftTosqmetre(sqfeet);
tot1 = tot1 + sqmetre;
acres = sqmetresToacres(sqmetre);
min = minimum(min,x1);
max = maximum(max,x1);
cout << "equals to = " << sqmetre << "sq. metres"
<< endl << "equals to = " << acres << " acres" << endl;
cout << "Enter area in sq. feet : ";
cin >> sqfeet;
}//while
sqmetre = sqftTosqmetre(tot);
acres = sqmetresToacres(tot1);
cout << endl << "Total Area = " << tot << "sq. feet, " << sqmetre
<< " sq. metres, " << acres << " acres " << endl;
cout << "Minimum is : " << sqmetresToacres(sqftTosqmetre(min)) << " acres & "
<< "Maximum is : " << sqmetresToacres(sqftTosqmetre(max)) << " acres" <<endl << endl;
return 0;
}//main
double sqftTosqmetre(double dis)
{
return dis*0.092903;
}//sqftTosqmetre
double sqmetresToacres(double dis)
{
return dis/4046.856;
}//sqmetreToacres
double minimum(double x, double y)
{
if (x<y)
return x;
else
return y;
}
double maximum(double x, double y)
{
if (x>y)
return x;
else
return y;
}
using namespace std;
double sqftTosqmetre(double dis);
double sqmetresToacres(double dis);
double minimum(double x, double y);
double maximum(double x, double y);
int main()
{
double sqmetre , acres, sqfeet, x1;
double tot=0, tot1=0, min=0, max=0 ;
cout << "Enter area in sq. feet (-999 to stop) : ";
cin >> sqfeet;
if (sqfeet != (-999))
min = sqfeet;
while (sqfeet != (-999))
{
x1 = sqfeet;
tot = tot + sqfeet;
sqmetre = sqftTosqmetre(sqfeet);
tot1 = tot1 + sqmetre;
acres = sqmetresToacres(sqmetre);
min = minimum(min,x1);
max = maximum(max,x1);
cout << "equals to = " << sqmetre << "sq. metres"
<< endl << "equals to = " << acres << " acres" << endl;
cout << "Enter area in sq. feet : ";
cin >> sqfeet;
}//while
sqmetre = sqftTosqmetre(tot);
acres = sqmetresToacres(tot1);
cout << endl << "Total Area = " << tot << "sq. feet, " << sqmetre
<< " sq. metres, " << acres << " acres " << endl;
cout << "Minimum is : " << sqmetresToacres(sqftTosqmetre(min)) << " acres & "
<< "Maximum is : " << sqmetresToacres(sqftTosqmetre(max)) << " acres" <<endl << endl;
return 0;
}//main
double sqftTosqmetre(double dis)
{
return dis*0.092903;
}//sqftTosqmetre
double sqmetresToacres(double dis)
{
return dis/4046.856;
}//sqmetreToacres
double minimum(double x, double y)
{
if (x<y)
return x;
else
return y;
}
double maximum(double x, double y)
{
if (x>y)
return x;
else
return y;
}
0 comments:
Post a Comment