コード例 #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
ファイル: Program.cs プロジェクト: muzakker/OOP-2-CSharpLang
        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;
 }