Shafi Project
Shafi Project
#include <string>
using namespace std;
class adminShafi;
class vehicleShafi {
private:
int registerationNumber;
protected:
string model;
public:
vehicleShafi() {
registerationNumber = 97;
model = "Civic";
}
void displayVehicle() {
cout << "Registeration Number: " << registerationNumber << endl;
cout << "Vehicle Model: " << model << endl;
}
friend class adminShafi;
};
class ownerDetailShafi : public vehicleShafi {
protected:
string ownerName;
string contactInfo;
public:
ownerDetailShafi() {
ownerName = "Shafi Ullah";
contactInfo = "0321 1234567";
}
void displayOwnerDetail() {
cout << "Owner Name: " << ownerName << endl;
cout << "Contact Information: " << contactInfo << endl;
}
};
}
void displaymaintainenceLogDetail() {
cout << "Maintainence Record: " << maintainenceRecord << endl;
}
};
}
void displayTrafficViolationRecord() {
cout << "Tickets Issued: " << ticketIssued<< endl;
cout << "Violation details: " << violationDetails << endl;
}
};
class insuranceDetailsShafi {
protected:
string insuranceCompany;
int policyNumber;
public:
insuranceDetailsShafi() {
insuranceCompany = "Habib insurance";
policyNumber = 123789;
}
void displayInsuranceDetail() {
cout << "Insurance Company: " << insuranceCompany << endl;
cout << "Policy Number: " << policyNumber << endl;
}
};
performanceMetricsShafi() {
engineHealth = "Fair";
fuelEfficiency = "12 L/kl";
}
void displayPerformanceMetrics() {
cout << "Engine Health: " << engineHealth << endl;
cout << "Fuel Effiecieny " << fuelEfficiency<< endl;
}
};
class adminShafi{
private:
int adminID;
public:
adminShafi(){
adminID = 112;
}
void updateVehicleInfo(vehicleShafi& obj) {
cout << "Admin ID: " << adminID << endl;
obj.registerationNumber = 798;
cout << "Updated Vehicle Registeration Number: " <<
obj.registerationNumber << endl;
}
};
int main() {
vehicleShafi v;
ownerDetailShafi o;
maintainenceLogShafi m;
trafficViolationRecordShafi t;
insuranceDetailsShafi i;
performanceMetricsShafi p;
adminShafi a;
int choice;
do {
cout << "\n\nEnter Choice\n1. Vehicle Details\n2. Owner Details\n3.
Maintainence Log\n4. Traffic Violations\n5. Insurance Details\n6. Performance
Metrics\n7. Admin\n0. Exit" << endl;
cin >> choice;
switch (choice) {
case 1: cout << "\n===VEHICLE DETAILS===" << endl; v.displayVehicle();
break;
case 2: cout << "\n===OWNER DETAILS===" << endl;
o.displayOwnerDetail(); break;
case 3: cout << "\n===MAINTAINENCE LOG===" << endl;
m.displaymaintainenceLogDetail(); break;
case 4: cout << "\n===TRAFFIC VIOLATION===" << endl;
t.displayTrafficViolationRecord(); break;
case 5: cout << "\n===INSURANCE DETAILS===" << endl;
i.displayInsuranceDetail(); break;
case 6: cout << "\n===PERFORMANCE METRICS===" << endl;
p.displayPerformanceMetrics(); break;
case 7: cout << "\n===ADMIN===" << endl; a.updateVehicleInfo(v); break;
case 0: cout << "Exiting" << endl; break;
default: cout << "Invalid choice" << endl; break;
}
} while (choice != 0);
return 0;
}