Guest User

OOP Code - Unfinished

a guest
Apr 14th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const float PI = 3.14159;
  5. enum _Shape { square=1, rectangle, triangle, circle } ;     //Enum variable declaration and intilization.
  6.  
  7. // Main class to cover all shapes
  8. class Shapes {
  9.     int choice;
  10.     int _s1, _s2, _s3;      //Sides of shape.
  11.     int _b, _h;             //Base and Height of a Triangle.
  12.     float _r;               //Radius of Circle.
  13. public:
  14.     // Area Calculation based on parameters
  15.     float area () {
  16.         switch (choice) {
  17.  
  18.  
  19.  
  20.         }
  21.     }
  22.  
  23.  
  24. };
  25.  
  26. // Simple function for printing Menu Lists.
  27. void printMenu() {
  28.     cout << "Welcome to OOP Principles!\n";
  29.     cout << "Please choose a shape from the below list:\n\n";
  30.     cout << "["<< square    << "] Square.\n";
  31.     cout << "["<< rectangle << "] Rectangle.\n";
  32.     cout << "["<< triangle  << "] Triangle.\n";
  33.     cout << "["<< circle    << "] Circle.\n";
  34.     cout << "";
  35. }
  36.  
  37. void main () {
  38.     bool loop = true;       //For do-while checking
  39.     do {
  40.         printMenu();
  41.         cin.get();
  42.     } while (loop);
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment