[求助]索引錯了``!!
下面的索引錯了``高手們幫忙看看啊!!!using System;
using System.Windows.Forms;
class TextBook
{
private string T;
private string A;
private float C;
private int Q;
public string Tile
{
get
{
return T;
}
set
{
value = T;
}
}
public string Author
{
get
{
return A;
}
set
{
value = A;
}
}
public float Cost
{
get
{
return C;
}
set
{
value = C;
}
}
public int Quantity
{
get
{
return Q;
}
set
{
value = Q;
}
}
public double P;
public string Price()
{
P= 1.25 * Cost;
return String.Format("书名:{0}\n作者:{1}\n批发价:{2}\n库存数量:{3}\n零售价:{4}\n",Tile, Author, Cost, Quantity);
}
public static void Main()
{
string output;
TextBook T1 = new TextBook();
output = ">>教科书有关记录<<\n";
T1.Tile = "新华字典";
T1.Author = "张三";
T1.Cost = 20;
T1.Quantity = 30;
output += T1.Price() + "\n";
MessageBox.Show(output, "输出结果");
}
}