したがって、次の情報を含むクラスを作成する必要があります。以下の情報を最も多く含むクラスを作成したか、少なくとも作成しましたが、入学番号と年号の数値の範囲を設定するのに問題があり、誰でも私を助けることができます
C# で Student 型のクラスを実装します。このクラスは、ファイル Student.cs に含まれている必要があります。クラスは次の仕様に準拠する必要があります。
プロパティの例のデータの検証
名「バジル」 空白ではありません
SecondName “Fawlty” 空白ではありません
生年月日 1946 年 8 月 23 日 空白ではない
コース「MAホテルマネジメント」空欄不可
入学許可番号 12345 10000~99999の範囲
年マーク 55 0 ~ 100 の範囲内
私のクラスのためにこれまでに持っているものはここにあります。うまくいけば、これまでのところ正しいです
namespace Student
{
public class Student
{
private string firstname;
private string secondname;
private double dateofbirth;
private string course;
private int matricnumber;
private int yearmark;
public Student()
{
firstname = "Basil";
secondname = "Fawlty";
dateofbirth = 23/08/1946;
course = "MA Hotel Management";
matricnumber = 12345;
yearmark = 55;
}
public string FirstName
{
get { return firstname; }
set { firstname = value; }
}
public string SecondName
{
get { return secondname; }
set { secondname = value; }
}
public double DateOfBirth
{
get { return dateofbirth; }
set { dateofbirth = value; }
}
public string Course
{
get { return course; }
set { course = value; }
}
public int Matricnumber
{
get { return matricnumber; }
set { matricnumber = value; }
}
public int YearMark
{
get { return yearmark; }
set {yearmark = value; }
}
}
}