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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!