public string ItemName { get; set; }
public decimal BasePrice { get; set; }
public string Tax { get; set; }
public decimal Total { get; set; }
Console.WriteLine("Enter Item Name");
this.ItemName = Console.ReadLine();
Console.WriteLine("Enter Item Price");
this.BasePrice = Convert.ToDecimal(Console.ReadLine());
if(this.BasePrice > 120 && this.BasePrice < 500)
decimal remainingPrice = this.BasePrice - 120;
taxAmount = ((remainingPrice * 10) / 100);
this.Tax = taxAmount > 0 ? Convert.ToString(taxAmount) : "Nil";
this.Total = this.BasePrice + taxAmount;
else if (this.BasePrice >= 500)
decimal remainingPrice1 = 500 - 120;
decimal tax1 = ((remainingPrice1 * 10) / 100);
decimal remainingPrice2 = this.BasePrice - 500;
decimal tax2 = Math.Round(((remainingPrice2 * 20) / 100), 2, MidpointRounding.AwayFromZero);
decimal totalTax = tax1 + tax2;
this.Tax = totalTax > 0 ? Convert.ToString(totalTax) : "Nil";
this.Total = this.BasePrice + totalTax;
this.Total = this.BasePrice;
var table = new ConsoleTable("Item", "Base Price", "Tax", "Total");
table.AddRow(this.ItemName, this.BasePrice, this.Tax, this.Total);
public static void Main()