Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const float PI = 3.14159;
- enum _Shape { square=1, rectangle, triangle, circle } ; //Enum variable declaration and intilization.
- // Main class to cover all shapes
- class Shapes {
- int choice;
- int _s1, _s2, _s3; //Sides of shape.
- int _b, _h; //Base and Height of a Triangle.
- float _r; //Radius of Circle.
- public:
- // Area Calculation based on parameters
- float area () {
- switch (choice) {
- }
- }
- };
- // Simple function for printing Menu Lists.
- void printMenu() {
- cout << "Welcome to OOP Principles!\n";
- cout << "Please choose a shape from the below list:\n\n";
- cout << "["<< square << "] Square.\n";
- cout << "["<< rectangle << "] Rectangle.\n";
- cout << "["<< triangle << "] Triangle.\n";
- cout << "["<< circle << "] Circle.\n";
- cout << "";
- }
- void main () {
- bool loop = true; //For do-while checking
- do {
- printMenu();
- cin.get();
- } while (loop);
- }
Advertisement
Add Comment
Please, Sign In to add comment