using System.Collections.Generic;
using System.Threading.Tasks;
namespace ConsoleApplication13
public static Dictionary<string, int> productlist = new Dictionary<string, int>();
public static void Main(string[] args)
choice = int.Parse(Console.ReadLine());
Console.WriteLine("Good Bye! Thank you for transacting with us");
System.Threading.Thread.Sleep(500);
default: Console.WriteLine("Choice not in the menu, press key to continue."); break;
Console.WriteLine(e.Message + " Try again...!");
public static void DrawLine()
Console.WriteLine("=============================================");
public static void DisplayTitle()
Console.WriteLine(" +++ KD & MJ Shop (POS) +++ ");
public static void DisplayMenu()
Console.WriteLine("\t1. Add a Product");
Console.WriteLine("\t2. View Product List");
Console.WriteLine("\t3. Delete a Product");
Console.WriteLine("\t4. Transact Sales");
Console.WriteLine("\t5. Exit Program");
Console.WriteLine("Make your choice type: 1, 2,... or 5 for exit");
public static void AddNew()
Console.WriteLine("= = = = = = < Add New Product > = = = = = =");
Console.Write("Product Name: ");
Console.Write("Product Price: ");
pP= double.Parse(Console.ReadLine());
if (! productlist.ContainsKey(pN))
Console.WriteLine("! Product added to the system.");
Console.Write("!Product already exist");
Console.WriteLine("Press any key to continue, [x] to stop");
Console.WriteLine("! Product not added. " + err.Message);
Console.WriteLine("Press any key to continue, [x] to stop");
public static void View()
Console.WriteLine("= = = = = = < Product List View > = = = = = ");
foreach (var kvG in productlist)
Console.Write(String.Format("Product name: {0}\n", kvG.Key + "Product price: {0:N}\n", kvG.Value));
public static void Delete()
Console.WriteLine("= = = = = = < Delete Product > = = = = = =");
public static void Transact()
Console.WriteLine("= = = = = = < Transact Sales > = = = = = =");