Question: Having a C# coding issue. Line for(int x = 0; x < items.Length; ++x) is messing up my code. I get a special kind of
Having a C# coding issue. Line "for(int x = 0; x < items.Length; ++x)" is messing up my code. I get a special kind of error. HELP!
using static System.Console;
using System.Globalization;
class DebugSix01
{
static void Main()
{
string[] items = {"Belt", "Tie", "Scarf", "Cufflinks"};
double[] prices = {29.00, 35.95, 18.50, 112.99};
WriteLine("Items for sale:");
for(int x = 0; x < items.Length; ++x)
WriteLine("{0,12} for {1,10}}",
items[x], prices[x].ToString("C", CultureInfo.GetCultureInfo("en-US")));
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
