コード例 #1
0
ファイル: Program.cs プロジェクト: yunamarth/Demo08
        static void Main(string[] args)
        {
            Invoice invoice = new Invoice { Customer = "Kirsi Kernell" };
            InvoiceItem milk = new InvoiceItem { Name = "Milk", Price = 2.50, Quantity = 2 };
            InvoiceItem bread = new InvoiceItem { Name = "Bread", Price = 1.90, Quantity = 1 };
            InvoiceItem eggs = new InvoiceItem { Name = "Eggs", Price = 1.50, Quantity = 2 };
            InvoiceItem spices = new InvoiceItem { Name = "Spices", Price = 4.50, Quantity = 1 };
            InvoiceItem butter = new InvoiceItem { Name = "Butter", Price = 2.20, Quantity = 2 };

            invoice.AddItem(milk);
            invoice.AddItem(bread);
            invoice.AddItem(eggs);
            invoice.AddItem(spices);
            invoice.AddItem(butter);

            Console.WriteLine(invoice.ToString());

        }
コード例 #2
0
ファイル: Program.cs プロジェクト: H8872/Demo8
 static void Main(string[] args)
 {
     Invoice receipt = new Invoice();
     Console.WriteLine(receipt.PrintInvoice());
 }