Untitled

 avatar
unknown
csharp
a year ago
3.0 kB
3
Indexable
public class Program
{
    private static void Main(string[] args)
    {
        Market market = new Market(
            "Nur",
            new Product[]
            {
             new Product(
                 "Qymyz",
                 "Drink",
                 new Gabaryte(2f,3f,4f),
                 new Person("Almat","Nur",
                    new Location("Qazaqstan","Atyrau", "Satpayev","2A")),
                 new Person("Shynggys","Seitekov",
                    new Location("Qazastan", "Atyrau", "Zhumagaliyeva","15R")),
                 4,
                 10),
            new Product(
                 "Et",
                 "Food",
                 new Gabaryte(1f,2f,3f),
                 new Person("Shynggys","Seitekov",
                    new Location("Qazaqstan","Almaty", "Al-Farabi","20C")),
                 new Person("Almat","Nur",
                    new Location("Qazastan", "Atyrau", "Samal","12A")),
                 4,
                 10)

            },

            new Location("Qazaqstan", "Atyrau", "Beibarys", "14d"));
    }
}
class Product
{
    public string? Name;
    public string? Description;
    public Gabaryte Gabaryte;
    public Person? Seller;
    public Person? Buyer;
    public int Rating;
    public int Price;

    public Product(
        string? name,
        string? description,
          Gabaryte gabaryte,
        Person? seller,
        Person? buyer,
        int rating,
        int price)

    {
        Name = name;
        Description = description;
        Seller = seller;
        Buyer = buyer;
        Rating = rating;
        Price = price;
        Gabaryte = gabaryte;
    }
}

class Person
{
    public string FirstName;
    public string LastName;
    public Location Location;

    public Person(string firstName, string lastName, Location location)
    {
        FirstName = firstName;
        LastName = lastName;
        Location = location;
    }
}

class Market
{
    public string? Name;
    public Product[]? Products;
    public Location Location;

    public Market(string? name, Product[]? products, Location location)
    {
        Name = name;
        Products = products;
        Location = location;
    }
}

class Location
{
    public string Country;
    public string City;
    public string Street;
    public string Building;

    public Location(string country, string city, string street, string building)
    {
        Country = country;
        City = city;
        Street = street;
        Building = building;
    }
}

class Package
{
    public Size? Size;
    public float Price;
    public Gabaryte Gabaryte;
}

enum Size
{
    None,
    S,
    M,
    L,
    XL
}
class Gabaryte
{
    public float Length;
    public float Height;
    public float Width;

    public Gabaryte(float length, float height, float width)
    {
        Length = length;
        Height = height;
        Width = width;
    }
}
Editor is loading...
Leave a Comment