1234567891011121314151617181920212223242526272829303132333435363738 |
- namespace ClassLibrary1;
-
- public class Place
- {
- public string Name { get; set; }
- public int Price { get; set; }
- public Place(string name, int price)
- {
- Name = name;
- Price = price;
- }
- public void Display()
- {
- Console.WriteLine($"{Name} - ${Price}");
- }
- }
- public class Workers
- {
- public string Name { get; set; }
- public Workers(string name)
- {
- Name = name;
- }
- public void Order(List<Place> places)
- {
- Console.WriteLine($"{Name} проводит экскурсию в: ");
- foreach (var place in places)
- {
- place.Display();
- }
- }
- }
|