private class Box{
private float len=0;
private float wid=0;
private float high=0;
public Box(){}
public Box(float len,float wid,float high){this.len=len;this.wid=wid;this.high=high;}public float QueryPerimeter(float len, float wid, float high){float result=0;result =4*(len +wid+high);return result;}public float QueryArea(float len,floatwid, floathigh){float result =0;result =len* wid*high;return result;}public void Write(){Console.Write(string.Format(长为{0},this.len));Console.Write(string.Format(宽为{0},this.wid));Console.Write(string.Format(高度{0},this.high));}public void Modify(float len,float wid,float high){this.len=len;this.wid=wid;this.high=high;}}赞同0|评论 |