예제 #1
0
 internal Product(ushort id, byte quantity, double price, ProductionDate dateOfProduction, string manufacturerName)
 {
     this.Id               = id;
     this.Quantity         = quantity;
     this.Price            = price;
     this.DateOfProduction = dateOfProduction;
     this.ManufacturerName = manufacturerName;
 }
예제 #2
0
        static void Main(string[] args)
        {
            ProductionDate productOneDate = new ProductionDate(12, "Nov", 2020);
            Product        productOne     = new CannedFood(101, 1, 43.50, productOneDate, "Pran");

            productOne.ShowInfo();

            ProductionDate productTwoDate = new ProductionDate(10, "Nov", 2020);
            Product        productTwo     = new Laptop(121, 1, 12343, productTwoDate, "Dell", 2, 2.75, 4);

            productTwo.ShowInfo();
        }
예제 #3
0
 internal void ExpiryDate(ProductionDate DateofProduction)
 {
     Console.WriteLine("Expiration Date of the Product: {0}/{1}/{2}", DateOfProduction.day, DateOfProduction.month, DateOfProduction.year + 1);
 }
예제 #4
0
 internal CannedFood(ushort id, byte quantity, double price, ProductionDate dateOfProduction, string manufacturerName) : base(id, quantity, price, dateOfProduction, manufacturerName)
 {
     //
 }
예제 #5
0
 internal Laptop(ushort id, byte quantity, double price, ProductionDate dateOfProduction, string manufacturerName, ushort memorySize, double clockSpeed, double batteryLife) : base(id, quantity, price, dateOfProduction, manufacturerName)
 {
     this.Memory      = memory;
     this.ClockSpeed  = clockSpeed;
     this.BatteryLife = batteryLife;
 }