Hello, I have a list that holds transactions. Currently I'm trying to write it to the console and have each transaction numbered with the transaction amount included beside it. I currently have code that produces something like
Transaction #1: $400
Transaction #1: $400
Transaction #2: $599.99
Transaction #2: $599.99
How do I stop this? Obviously my code is wrong, here is what I have that's writing to console:
foreach(decimal transaction in transactions)
{
for(decimal i=1; i<=transactions.Count; i++)
{
Console.WriteLine("Transaction #{0}: ${1}", i, transaction);
}
}
If I need to post my whole program I can, but this is where it's all happening.