Each of the following projects in the Chapter.12 folder of your downloadable student files has syntax and/or logical errors. Immediately save the four project folders with their new names before starting to correct their errors. After you correct the errors, save each project using the same name preceded with Fixed. For example, DebugTwelve1 will become FixedDebugTwelve1

Respuesta :

Answer:

a) DebugTwelve1.cs

Code:

namespace FixedDebugTwelve1

{

//add code from textbook

// .

// .

// .

redLabel.Color = Red;

blueLabel.Color = BlueViolet;

greenLabel.Color = Green;

label.Visible = false;

}

Explanation:

Error1:

  • In C# there is no property of a form component as label.
  • Its either BackColor or ForeColor
  • And Color values can't be assigned directly.

The correct statement is as follows:

redLabel.BackColor = System.Drawing.Color.Red;

blueLabel.BackColor = System.Drawing.Color.BlueViolet;

greenLabel.BackColor = System.Drawing.Color.Green;

Error2:

It is a logical error, label4 should chenge visibility when button1 is clicked.

The correct statement is as follows:

label4.Visible = true;

See attachment for the remaining 3 projects