using System;
using System.Windows.Forms;
class TextBook
{
private string T;
public string Tile
{
get
{
return T;
}
set
{
T = value;
}
}
private string A;
public string Author
{
get
{
return A;
}
set
{
A = value;
}
}
private int Q;
public int Quantity
{
get
{
return Q;
}
set
{
Q = value ;
}
}
public double P;
private int Cost;
public string Price()
{
P= 1.25 * Cost;
return String.Format("书名:{0}\n作者:{1}\n批发价:{2}\n库存数量:{3}\n批发价:{4}}\n",Tile, Author, Cost, Quantity,Price);
}
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, "输出结果");
}
}
各为高手看看 晚上这调试不出 在着小弟谢拉