[solved] C# final code project, need help
I'm trying to solve the project like in the lesson before but I can't make it work. I get exceptions without specific lines mentioned. Any help is welcome. Task: A discount is given and the dictionary should update and print the new prices. Code: int discount = Convert.ToInt32(Console.ReadLine()); Dictionary<string, int> coffee = new Dictionary<string, int>(); coffee.Add("Americano", 50); coffee.Add("Latte", 70); coffee.Add("Flat White", 60); coffee.Add("Espresso", 60); coffee.Add("Cappuccino", 80); coffee.Add("Mocha", 90); //your code goes here foreach(string s in coffee.Keys){ coffee[s] = coffee[s]/100 *(100-discount); Console.WriteLine(s+" :"+coffee[s]); }