You are on page 1of 2

//

// main.cpp
// sec07_26
//
// Created by James Varga on 2/17/20.
// Copyright © 2020 James Varga. All rights reserved.
//

#include <iostream>
#define PI 3.14

using namespace std;

void initMenu();
void menuDecision(int);
double areaCircle(double);

int main(int argc, const char * argv[]) {

int choice;

initMenu();

cin >> choice;

menuDecision(choice);

return 0;
}

void initMenu()
{
cout << "Enter Option:" << endl;
cout << "1. Circle" << endl;
cout << "2. Square" << endl;
cout << "3. Rectangle" << endl;
cout << "4. Triangle" << endl;
}

void menuDecision (int choice)


{
double r;
switch(choice)
{
case 1:
cout << "Enter the radius: " << endl;
cin >> r;
break;
case 2:
cout << "Enter the radius: " << endl;
break;
case 3:

break;
case 4:

break;
default:
cout << "You didn't Choos any of the options from above" << endl;
}
}

double areaCircle (double r)


{
double result = PI * r * r;

cout << "The area of a circle that radius is: " << r << " " << result << endl;

return result;
}

You might also like