// Add a student to the classroom
void addStudent(string student) {
if (students.size() < capacity) {
students.push_back(student);
cout << student << " sinfga qo'shildi.\n";
} else {
cout << "Sinf to'ldirilgan, " << student << " sinfga qo'shilmadi.\n";
}
}
// Display classroom
information
void displayInfo() const {
cout << "Sinf ma'lumotlari:\n";
cout << "Sinf raqami: " << roomNumber << endl;
cout << "Sinf sigimi: " << capacity << " o'quvchi" << endl;
cout << "Hozirgi o'quvchilar:\n";
for (const string& student : students) {
cout << "- " << student << endl;
}
}
};
int main() {
// O'quv xonasi obyekti yaratish
Classroom classroom("101", 30);
// O'quvchilarni sinfga qo'shish
classroom.addStudent("Ali");