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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#include <iostream>
#include <string>
//#include<conio.h>
using namespace std;
class Property {
string type;
string name;
string status;
int no {};
public:
//Setter(Method)
void set_FieldName() {}
void set_delprop() {}
//Getter(Method)
void get_FieldName() {}
//Constructor
Property() {}
Property(int o, const string& t, const string& n, const string& s) : no(o), type(t), name(n), status(s) {}
};
//Derived Class
class Details : public Property {
Property e[10] {};
Property temp[10] {};
public:
void AddProperty() {}
void DeleteProperty() {}
void ViewProperty() {}
void SearchProperty() {}
};
int main()
{
Property prop1(1, "Residential", "Terrace", "Rent");
Property prop2(2, "Residential", "Bungalow", "Sale");
Property prop3(3, "Commercial", "Factory", "Sale");
Property prop4(4, "Commercial", "Malls", "Sale");
Property prop5(5, "Commercial", "Farmlands", "Rent");
Details info;
while (1) {
cout << "\n\t\t\t\t\t1 : Add details of item" << endl;
cout << "\t\t\t\t\t2 : Delete item details" << endl;
cout << "\t\t\t\t\t3 : View all category of item" << endl;
cout << "\t\t\t\t\t4 : View a property" << endl;
cout << "\t\t\t\t\t0 : Exit" << endl;
cout << endl << "\t\t\tEnter selection : ";
int selection {};
cin >> selection;
switch (selection) {
case 1: info.AddProperty(); break;
case 2: info.DeleteProperty(); break;
case 3: info.ViewProperty(); break;
case 4: info.SearchProperty(); break;
case 0: /*system("cls");*/ exit(0); break;
default:
cout << "\nInvalid selection" << endl;
cout << "Press Enter to continue" << endl;
//getch();
break;
}
//system("cls");
}
}
|