hey im writting a simple code for a school assignment and for the life of me i cant figure out whats wrong with it, here it is
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int choice;
double a,r,l,w;
const double z = 3.14159;
const double k = .5;
cout<<"Which would you like to do?/n";
cout<<"Enter 1 for area of a circle/n";
cout<<"Enter 2 for area of a rectangle/n";
cout<<"Enter 3 for area of a Triangle/n";
cout<<"Enter 4 if you are a nancy/n";
cin >> choice;
if(choice>=1 && choice<=3)
{
switch(choice)
{
case 1: cout<<"What is the radius?/n";
cin << r;
a=z*(r*r);
cout<<"The area equals " <<a;
break;
case 2: cout<<"What are the width and legnth of the rectangle?/n";
cin>> w >> l;
a=l*w;
cout <<"The area equals " <<a;
break;
case 3: cout<<"What are the base and height of the triagnle?/n";
cin>> l >> w;
a=l*w*k;
cout<<"The area euqals "<<a;
case 4: break;
}
}
else if (x!=4)
{
cout<<"That's not a choice, re-run the program";
}
system("pause");
return 0;
}
if anyone could help me it would be much appreciated