



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




#include
int main() { Item item1("Apple", 50, 5); item1.display(); return 0; }
#include
accountCount++; } static int getAccountCount() { return accountCount; } void display() { cout << "Name: " << name << ", Balance: " << balance << endl; } }; int BankAccount::accountCount = 0; int main() { BankAccount acc1("Abdullah", 1000.0); BankAccount acc2("Ali", 1500.0); cout << "Total accounts created: " << BankAccount::getAccountCount() << endl; return 0; }
#include
specialization = s; experienceYears = e; } }; class Patient { public: string name; string disease; Doctor doctor; static int patientCount; Patient(string n, string d, Doctor doc) : doctor(doc) { name = n; disease = d; patientCount++; } void display() { cout << "Patient Name: " << name << endl; cout << "Disease: " << disease << endl; cout << "Assigned Doctor: " << doctor.name << endl; cout << "Specialization: " << doctor.specialization << endl; cout << "Experience: " << doctor.experienceYears << " years\n"; } static int getPatientCount() { return patientCount; } };