1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#include <iostream>
#include <math.h>
#include <iomanip>
#include "stdafx.h"
using namespace std;
main()
{
int a, b, c, circle_area, s, rectangle_area, triangle_area, radious, quit, area, width, length, height;
const double PI = 3.14;
cout << "enter 1 for the radious circle" << radious << "enter the area of a circle" << circle_area << endl;
cout << "Enter 2 for the width of the rectangle" << width <<"enter the length of the rectangle"<< length << "enter the area of the rectangular"<< rectangle_area << endl;
cout << "Enter 3 for the lenght of the triangle" << length<< " enter the area of a triangle" << triangle_area << endl;
cout << "Enter 4 for the program to quit" << quit <<endl;
switch (area)
{
case 1:
cout << "enter the radious of a circle\n";
cin >> radious;
cout << " enter the area of a circle. \n";
cin >> circle_area;
circle_area= PI * radious * radious;
cout << "area of the circle is" << circle_area << endl;
break;
case 2:
cout << "enter the width of a rectangle" << width << endl;
cin >> width;
cout << "enter the length of the rectangle" << length << endl;
cin >> length;
cout << "enter the area of the rectangl" << area << endl;
cin >> rectangle_area;
rectangle_area = a * b;
cout << "Rectangular Area =" << triangle_area << endl;
break;
case 3:
cout << "enter the length of a triangle" << length << endl;
cin >> length;
cout << "enter the height of a triangle" << height << endl;
cin >> height;
s = (a + b + c) / 2;
triangle_area = sqrt(s*(s - a)*(s - b)*(s - c));
cout << "Triangle Area=" << triangle_area << endl;
cin >> triangle_area;
break;
case 4:
cout << "program quit" << quit << endl;
cin >> quit;
return 0;
}
when I debug, it says cin, cout, int hasn't been initialized. I'm not what I'm not sure wats wrong with my code.
I appreciate your help!
|