Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            CashRegister till1 = new CashRegister();
            CashRegister till2 = new CashRegister();

            till1.TillNum = 1;
            till2.TillNum = 2;


            till1.RegisterInitialise(50);
            till2.RegisterInitialise(50);

            till1.Sale(12.99M);
            till1.Sale(14M);
            till1.Sale(9.99M);
            till1.Sale(123M);

            till2.Sale(12.99M);
            till2.Sale(78M);
            till2.Sale(5.99M);
            till2.Sale(23.99M);

            till1.DisplayStatus();
            till2.DisplayStatus();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            CashRegister c1 = new CashRegister();

            Console.WriteLine("New item worth 12.80 to the First cash Register");
            Console.WriteLine("New item worth 22.50 to the First cash Register");
            Console.WriteLine("New item worth 38.65 to the First cash Register");

            c1.AddItem(12.80);
            c1.AddItem(22.50);
            c1.AddItem(38.65);

            CashRegister c2 = new CashRegister();

            Console.WriteLine("New item worth 3.78 to the second cash register");
            Console.WriteLine("New item worth 5.68 to the second cash register");
            Console.WriteLine("New item worth 56.12 to the second cash register");
            Console.WriteLine("New item worth 89.45 to the second cash register");
            Console.WriteLine("New item worth 19.23 to the second cash register");

            c2.AddItem(3.78);
            c2.AddItem(5.68);
            c2.AddItem(56.12);
            c2.AddItem(89.45);
            c2.AddItem(19.23);

            Console.WriteLine("First cash register total : {0}", c1.Total);
            Console.WriteLine("First cash register Number of items : {0}", c1.NumberOfItems);

            Console.WriteLine("Second cash register total : {0}", c2.Total);
            Console.WriteLine("Second cash register Number of items : {0}", c2.NumberOfItems);
        }
        static void Main(string[] args)
        {
            CashRegister cr1 = new CashRegister("Cash Register 1");

            cr1.addItem(2.70);
            cr1.addItem(3.45);
            cr1.addItem(5.97);

            CashRegister cr2 = new CashRegister("Cash Regster 2");

            cr2.addItem(12.52);
            cr2.addItem(1.43);
            cr2.addItem(15.57);
            cr2.addItem(5.15);

            Console.WriteLine("{0} Total: {1}\nCash Register CR1 Total Number of Items: {2}", cr1.Name, cr1.Total, cr1.NumberOfItems);
            Console.WriteLine("{0} Total: {1}\nCash Register CR2 Total Number of Items: {2}", cr2.Name, cr2.Total, cr2.NumberOfItems);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            CashRegister reg1 = new CashRegister();

            reg1.AddItem(4.99M);
            reg1.AddItem(9.99M);
            reg1.AddItem(3.50M);
            reg1.AddItem(99.98M);

            Console.WriteLine("Basket 1, " + reg1);


            CashRegister reg2 = new CashRegister();

            reg2.AddItem(10.99M);
            reg2.AddItem(100.00M);
            reg2.AddItem(99.80M);
            reg2.AddItem(0.99M);
            reg2.AddItem(4.99M);

            Console.WriteLine("Basket 2, " + reg2);
        }