New course! Every coder should learn Generative AI!
Try a free lesson0
pricelist
How to create Pricelist on C#, please help mi out?
1 Answer
+ 1
You could use a Dictionary<U,V> so long as your items are all named differently.
Dictionary<string, float> priceList = new Dictionary<string, float>();
priceList.Add("Socks", 4.99f);
priceList.Add("Pants", 5.99f);
priceList.Add("T-Shirt", 14.99f);
And so on.....