#include < iostream >
using namespace std;
int main() {
int choice;
const double pi = 3.14;
double area, radius;
cout << "Welcome to the geometry calculator!\n";
cout << " 1. Calculate The Area OF A Circle:\n";
cout << " 2. Calculate The Area Of A Rectangle\n";
cout << " 3. Calculate The Area Of A Triangle\n";
cout << " 4. Quit The Application";
cin >> choice;
if (choice == 1) {
area = radius * radius * pi;
cout << "What is the radius of the circle?";
cin >> radius;
cout << "the area of the circle is" << area;
}
cin.get();
return 0;
}
This is a portion of code that i'm currently doing for homework. After compiling the code I'm presented with numerous errors all essentially saying the same thing. I don't understand what i'm doing wrong, anyone have any tips? Why do i have to initialize radius if its being used as an input?
Thanks for the down votes guys. Good to know that that seeking help will only get you ridiculed. I already attempted to look up the solution several times to no avail.