-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
52 lines (39 loc) · 1.07 KB
/
main.cpp
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
#include <iostream>
#include <cmath>
#include "shapes-2D.cpp"
#include "shapes-3D.cpp"
using namespace std;
void showMenu() {
cout << "\n********** MENU *********" << endl;
cout << "| " << "1. Square\t\t|" << endl;
cout << "| " << "2. Rectangle\t\t|" << endl;
cout << "| " << "3. Triangle\t\t|" << endl;
cout << "| " << "4. Circle\t\t|" << endl;
cout << "| " << "5. Parallelogram\t|" << endl;
cout << "| " << "6. Trapezium\t\t|" << endl;
cout << "| " << "7. Exit\t\t|" << endl;
cout << "*************************" << endl;
}
int main() {
cout << "\nWelcome to Geometry Calculator App.\n" << endl;
int option;
do {
showMenu();
cout << "Select shape to calculate area: ";
cin >> option;
system("clear");
switch(option) {
case 1: square(); break;
case 2: rectangle(); break;
case 3: triangle(); break;
case 4: circle(); break;
case 5: parallelogram(); break;
case 6: trapezium(); break;
}
if (!(option <= 7))
{
cout << "\nInvalid input! Try again: \n";
}
} while(option != 7);
return 0;
}