(Choose 1 answer)
What is the exact output of the below C# code?
static void Main(string[] args){
Dictionary<string, int> Cart = new Dictionary<string, int>();AddToCart(Cart, "A1", 3);
AddToCart(Cart, "A1", 1);
AddToCart(Cart, "A2", 5);
AddToCart(Cart, "A2", 1);AddToCart(Cart, "A1", 1);
foreach (KeyValuePair<string, int> KV in Cart){
Console.WriteLine($"(KV.Key} {KV.Value}");
}
}
static void AddToCart(Dictionary<string, int> Cart, string Newltem,
int Qty){
if (Cart ContainsKey(NewItem)){
Cart[NewItem] += Qty;
} else{
Cart[NewItem] = Qty;
}
}
A. A15
A2 6
B. A1 6
A25
C. A13
A2 1
Exit 33