C#大神进来!!!跪求答案!!!在线等!!!急急急急!!!!

1、定义一个类CDate,实现对日期类的封装,私有类成员变量为year,month和day,成员函数voidinput_Date()和stringOutput_Date(... 1、 定义一个类CDate,实现对日期类的封装,私有类成员变量为year,month和day ,成员函数void input_Date()和string Output_Date()实现日期的输入与输出。
2、 定义一个矩形类CRectangle,要求具有以下成员:私有类成员变量l和s,表示矩形的长和宽;成员函数Area(),计算矩形的面积;成员函数Perimeter(),计算机矩形的周长;定义构造函数,通过构造函数完成变量的初始化。
3、 定义一个矩形类CRectangle,要求具有以下成员:属性l和s,表示矩形的长和宽,通过属性获取矩形的长和宽;成员函数Area(),计算矩形的面积;成员函数Perimeter(),计算机矩形的周长;
展开
 我来答
飞天杀手
2014-04-10 · TA获得超过153个赞
知道小有建树答主
回答量:211
采纳率:0%
帮助的人:170万
展开全部
public class CDate
{
    private int year { get; set; }
    private int month { get; set; }
    private int day { get; set; }
    protected void input_Date(DateTime dt)
    {
        this.year = dt.Year;
        this.month = dt.Month;
        this.day = dt.Day;
    }
    protected string Output_Date()
    {
        return this.year + "-" + this.month + "-" + this.day;
    }



public class CRectangle
{
    private int I { get; set; }
    private int S { get; set; }
    public CRectangle(int i, int s)
    {
        I = i;
        S = s;
    }
    public int Area()
    {
        return I * S;
    }
    public int Perimeter()
    {
        return (I + S) * 2;
    }
}

public class CRectangle
{
    public int I { get; set; }
    public int S { get; set; }
    public int Area()
    {
        return I * S;
    }
    public int Perimeter()
    {
        return (I + S) * 2;
    }
}
zhang399401
2014-04-10 · TA获得超过701个赞
知道小有建树答主
回答量:1347
采纳率:0%
帮助的人:891万
展开全部
不会这么懒吧,提示的这么清晰还不会?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式