hello there, it says that i have 2 errors in my code. What have i done wrong? (doesnt show where); something that calculates the area and the perimeter.
#include <iostream.h>
typedef unsigned short int pint;
int main()
{
pint width;
pint length;
pint area=(width*length);
pint perim=( (width+width) + ( length+length) );
pint answer;
cout<<"please Enter a value for width:";
cin>> width;
cout<<"\n thank you, please enter a value for length:\n";
cin>> length;
cout<<"\n-----<Menu>-----\n";
cout<<"\n Press 1 to calculate area\n";
cout<<"\n Press 2 to calculate the perimeter\n";
{
cin>> answer;
if (answer == 1)
{cout<<"\nThe area is:" << area << "m2";}
if (answer == 2)
{cout<<"\nThe perimeter is:" << perim << "meters\n";}
{
else
if (answer > 2)
{cout"\nInvalid command!\n";}
}
}
{cout<<"program now exiting...\n";}
return 0;
}
help required