User talk:Papuji

masterji
using namespace std; class Distance { int feet; int inches; public: Distance{} Distance(int feet,int inches) {    this->feet=feet; this->inches=inches; }      Distance operator+(Distance temp) {     Distance d3; d3.feet=this->feet+temp.feet; d3.inches=this->inches+temp.inches; return d3; }  int getFeet {   return feet; }  int getInches {  return inches; } }; int main {   Distance d(10,20); Distance d2(15,30); Distance d3; d3=d2+d; cout<>(istream &i,Distance &d); friend ostream& operator<<(ostream &out,Distance d); Distance{} Distance(int feet,int inches) {    this->feet=feet; this->inches=inches; }      Distance operator+(int temp) {     Distance d4; d4.feet=this->feet+temp; d4.inches=this->inches+temp; return d4; }  int getFeet {   return feet; }  int getInches {  return inches; }  void setFeet(int i)   { feet=i; }  void setInches(int j)   { inches=j; } }; void operator>>(istream &i,Distance &d) { cout<<"enter feet"; i>>d.feet; cout<<"enter inches"; i>>d.inches; } ostream& operator<<(ostream &out,Distance d) { out<<"FEET  :"<>d3; cout<id=id; this->name=name; }		Employee {		}		void display {		cout<<"\nId	: "< emplist; public: void addEmployee(Employee e,string s)    { emplist.insert(pair (s,e)); }   void displayList {     multimap::reverse_iterator ritr; for(ritr=emplist.rbegin;ritr!=emplist.rend;ritr++) {        if((*ritr).first=="h") {          ((*ritr).second).display; }       }     }  };  int main {   EmployeeUsingMultimap emp; Employee e1(1,"a"); Employee e2(2,"b"); Employee e3(3,"c"); emp.addEmployee(e1,"h"); emp.addEmployee(e2,"d"); emp.addEmployee(e3,"h"); emp.displayList; }
 * 1) include
 * 2) include

m1234
using namespace std; class Employee {   int id; string name; public: Employee(int id, string name) {       this->id=id; this->name=name; }          void display {     cout<<"ID is :"< emplist; public: void addEmployee(Employee e)     { emplist.push_back(e); }     void deleteEmployee {      emplist.pop_back; }    void displayList {      for(int i=0;i<emplist.size;i++) {        emplist.at(i).display; }     }     void swapEmployee {      swap(emplist[0],emplist[3]); }    void modifyEmployee(Employee e)      { emplist.at(2)=e; } };   int main {    Employeeusingdeque emp; Employee e1(1,"rahul"); Employee e2(2,"santhi"); Employee e3(3,"cheeku"); Employee e4(4,"honcho"); Employee e5(5,"bucchi"); emp.addEmployee(e1); emp.addEmployee(e2); emp.addEmployee(e3); emp.addEmployee(e5); emp.addEmployee(e4); emp.deleteEmployee; emp.displayList; cout<id=id; this->name=name; }   int getId {     return id; }   string getName {    return name; }  ~Person { cout<<"destructor person"<company=company; }   string getCom {      return company; }   ~Employee {     cout<<"destructor employee"<marks=marks; }   int getMarks {     return marks; }    ~Student {      cout<<"destructor student"<roll=roll; }	int getRoll {		return roll; }
 * 1) include

/* void print {      cout<<name<<id<<roll<<endl<<marks<<endl<name=name; this->age=age; }   void setAge(int a)     { age=a; }   void setName(string n)    {  name=n;   } int getAge {    return age; }  string getName {    return name; } void dispaly {    cout<<name<<endl<<age<<endl; } };  class PerOccupation:public Persondetails {  protected: string occupation; string qualification; public: PerOccupation {     occupation="job"; qualification="b.tech"; }    void setOcc(string s)     { occupation=s; }   void setQua(string s)     { qualification=s; }   void display1 {     cout<<name<<age<<occupation<<qualification<<endl; }  };  class PerOrg:public PerOccupation {  protected: string company; public: PerOrg {      company="tcs"; }    void display3 {     cout<<name<<age<<occupation<<qualification<<company; }  };  int main {   Persondetails p;    PerOccupation p1; PerOrg p2; p2.setAge(50); p2.setName("rahul"); p2.setOcc("abc"); p2.setQua("engneering"); p2.display3; }
 * 1) include