求助C#的一些问题

来源:百度知道 编辑:UC知道 时间:2024/06/19 01:58:51
本人是个C#盲,一点都不懂啊,现在遇到3个练习题,求助大家帮忙解决:
1.输入四个数,求最大值和最小值。其中数字应为实型数,使用数组保存。
2.输入一个字符串,将其中的所有小写英文字母转换成大写,最后输出转换后的字符串和转换的字母个数。
3.定义基类Person,包括姓名、年龄、编号三个数据成员,虚方法display用于显示这些信息。派生类Employee增加数据成员部门和工资,重写display方法用来显示全部数据成员信息。以上两个类包括自己的构造函数。在主函数中,根据人员类型的不同要求输入个人信息,创建不同的实例,并显示个人信息。
我需要详细的代码,并能运行出结果,谢了。
当然如果你帮我解决了这3个问题,我会追加分数的,必然不是小数目哈,再次谢咯。

class people
{
private string name;
private int age;
private int id;
public people()
{
this.name = "";
this.age = 0;
this.id = 0;
}
public people(string name,int age,int id)
{
this.name = name;
this.age = age;
this.id = id;
}

public virtual void display()
{
Console.WriteLine("name:"+name +"age:"+age.ToString ()+"id:"+id .ToString ());
}

}
class Employee : people
{
private string partment;
private decimal money;
public Employee(string partment,decimal money)
{
this.partment = partment;
this.money = money;
}
public Employee(string partment, decimal money,string name,int age,int id):base(name ,age ,id )
{
this.partment = partment;
this.money = money;
}
public override void display()
{
base.display();
Cons