根据要求编写C#类,完成面向对象编程

根据要求编写C#类,完成面向对象编程

根据下图的要求编写C#面向对象编程

img

using System;
namespace ConsoleApp2
{
    class Student
    {
        public string m_Name { get; set; }
        public string m_IdNo { get; set; }
        public int m_Score { get; set; }
        public void m_SetInfo(string m_Name, string m_IdNo, int m_Score)
        {
            this.m_Name = m_Name;
            this.m_IdNo = m_IdNo;
            this.m_Score = m_Score;
        }
        public void m_DisplayInfo()
        {
            Console.WriteLine($"姓名:{m_Name}\t学号:{m_IdNo}\t成绩:{m_Score}");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            var stu = new Student();
            stu.m_SetInfo("张三", "001", 90);
            stu.m_DisplayInfo();
 
            Console.ReadKey();
        }
    }
}
 
 
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632