Files
2026-07-14 12:46:00 +03:00

9 lines
866 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
**Постановка:** Есть Машина, Гараж и Механик.
**Задание:**
1. Класс `Car`: параметры `model`, `mileage`, `is_service_needed` (булево).
2. Класс `Garage`: содержит список объектов `Car`. Метод `get_needs_service()` возвращает список машин с `is_service_needed = True`.
3. Класс `Mechanic`: имеет метод `service_car(car)`. При обслуживании `mileage` не меняется, а `is_service_needed` становится `False`.
**Тесты:**
1. Создайте гараж с 3 машинами (у 2-х установите `is_service_needed = True`).
2. Создайте механика.
3. Отфильтруйте машины, требующие ремонта, и обслужите их через механика.