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; }
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(); }
internal void ExpiryDate(ProductionDate DateofProduction) { Console.WriteLine("Expiration Date of the Product: {0}/{1}/{2}", DateOfProduction.day, DateOfProduction.month, DateOfProduction.year + 1); }
internal CannedFood(ushort id, byte quantity, double price, ProductionDate dateOfProduction, string manufacturerName) : base(id, quantity, price, dateOfProduction, manufacturerName) { // }
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; }