using System.Collections.Generic;
public static void Main()
Dictionary<string, int> toysSold = new Dictionary<string, int>() {
{"Gaming Consoles", 551},
toysSold.Add("GI Joe", 430);
Console.WriteLine(toysSold["GI Joe"]);
Console.WriteLine("****toysSold Dictionary****");
foreach (KeyValuePair<string, int> word in toysSold)
Console.WriteLine($"{word.Key} price ${word.Value}");
Dictionary<int, string> top5VideoGames = new Dictionary<int, string>();
top5VideoGames.Add(1,"HL2DM");
top5VideoGames.Add(2, "Diablo 2");
top5VideoGames.Add(3, "Halo 2");
top5VideoGames.Add(4, "World of Warcraft, vanilla");
top5VideoGames.Add(5, "Starcraft Broodwars");
Console.WriteLine("****Top 5 Video Games of all Time****");
foreach(KeyValuePair<int, string> game in top5VideoGames)
Console.WriteLine(game.Key + " " + game.Value);
Console.WriteLine("***How to check if a certain key exists in a dictionary with an if-else statement***");
if (top5VideoGames.ContainsKey(3))
value = top5VideoGames[3];
Console.WriteLine($"{value} exists in the dictionary");
Console.WriteLine("Key Not Present");