public static void DrawReceipt() { string format = "{0,15}{1,15}"; Console.WriteLine("Thank you for shopping with us"); CartView.DrawCart(); Console.WriteLine(); Console.WriteLine(format, $"Subtotal: ", $"{Cart.GetSubTotal():C2}"); Console.WriteLine(format, $"Sales Tax: ", $"{Cart.GetSalesTax():C2}"); Console.WriteLine(format, $"Total: ", $"{Cart.GetGrandTotal():C2}"); GetPaymentReceipt(Checkout.PaymentType); Console.WriteLine(); Console.WriteLine("Pleae visit us again soon!"); }
public static void CheckOut() { string format = "{0, 59}{1, 12}"; CartView.DrawCart(); Console.WriteLine(format, "Sub Total: ", $"{Cart.GetSubTotal():C2}"); Console.WriteLine(format, "Sales Tax: ", $"{Cart.GetSalesTax():C2}"); Console.WriteLine(format, "Grand Total: ", $"{Cart.GetGrandTotal():C2}"); PaymentType = GetPaymentType(); if (PaymentType == 1) { CashMoney.MakePayment(); } else if (PaymentType == 2) { CheckMoney.MakePayment(); } else if (PaymentType == 3) { CreditMoney.MakePayment(); } }