Пример #1
0
 private static void salesReceiptTotal(SalesTransactions saleTotal)
 {
     Console.WriteLine("Sales Receipt Total---");
     Console.WriteLine($"saleTotal is equal to: {saleTotal.SalesAmount}");
     Console.WriteLine("Sales Receipt Total End");
     exitProgram();
 }
Пример #2
0
 private static void saleReceipt(SalesTransactions sale)
 {
     Console.WriteLine("Sales Transaction Receipt---");
     Console.WriteLine($"Name of the Transaction is: {sale.Name}");
     Console.WriteLine($"Sales Amount of the Transaction is: {sale.SalesAmount}");
     Console.WriteLine($"Commission Rate of the Transaction is: {sale.CommissionRate}");
     Console.WriteLine("End of Sales Receipt");
     exitProgram();
 }
Пример #3
0
        static void Main(string[] args)
        {
            // Examples of sales using the three Constructors
            SalesTransactions januarySale  = new SalesTransactions("January", 22, 5.5f);
            SalesTransactions februarySale = new SalesTransactions("February", 32);
            SalesTransactions marchSale    = new SalesTransactions("March");

            // Examples of using the overloaded + operator, what's
            // really interesting is the implicit extension of multiple
            // operands that allow for growth.
            SalesTransactions janFebMarchSale = januarySale + februarySale + marchSale;

            // Terminal Logging
            saleReceipt(januarySale);
            saleReceipt(februarySale);
            saleReceipt(marchSale);
            salesReceiptTotal(janFebMarchSale);
            exitProgram();
        }