diff --git a/plane.cpp b/plane.cpp new file mode 100644 index 0000000..2193e7a --- /dev/null +++ b/plane.cpp @@ -0,0 +1,106 @@ +#include +#include +using namespace std; + +class aeroplane +{ + private: + string airline; + string dest; + static int count; + public: + aeroplane(string a,string d) + { + airline = a; + dest = d; + } + + string getAirline() + { + return airline; + } + + static int checkCount() + { + if(count<3) + return 1; + else + return 0; + } + + void landing() + { + cout<>ch; + switch(ch) + { + case 1: flag = aeroplane::checkCount(); + if(flag==0) + cout<<"Landing not Allowed since Runway is occupied"<>n; + cout<<"Enter the Destination of the Aeroplane :"<>d; + a[i] = new aeroplane(n,d); + a[i]->landing(); + i++; + } + break; + case 2: flag = aeroplane::giveCount(); + if(flag==0) + cout<<"No Flight currently on Runway to take off"<getAirline()<>f; + a[f-1]->takeOff(); + delete a[f-1]; + for(j=f-1;j