using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LINQ3
{
class Student
{
/// <summary>
///学生姓名的字段和属性
/// </summary>
private string _Name;
public string Name
{
get { return this._Name; }
}
private string _Xingbie;
/// <summary>
/// 学生性别的字段和属性
/// </summary>
public string Xingbie
{
get { return this._Xingbie; }
}
/// <summary>
/// 学生年龄的字段和属性
/// </summary>
private uint _Age;
public uint Age
{
get { return this._Age; }
}
/// <summary>
/// 学生成绩的字段和属性
/// </summary>
private List<LessonScore> _Scores;
public List<LessonScore> Scores
{
get { return this._Scores; }
}
/// <summary>
/// 构造函数,传入学生姓名,性别,年龄,成绩
/// </summary>
public Student(string name, string xb, uint age, List<LessonScore> scrs)
{
this._Name = name;
this._Xingbie = xb;
this._Age = age;
this._Scores = scrs;
}
public Student(string name, string xb, uint age)
{
this._Name = name;
this._Xingbie = xb;
this._Age = age;
this._Scores = null;
}
public override string ToString()
{
string str;
str = string.Format("{0}--{1}--{2}", this._Name, this._Age, this._Xingbie);
return str;
}
}
class LessonScore
{
/// <summary>
/// 课程成绩的字段和属性
/// </summary>
private float _Score;
public float Score
{
get { return this._Score; }
}
/// <summary>
/// 课程名称的字段和属性
/// </summary>
private string _Lessson;
public string Lesson
{
get { return this._Lessson; }
}
/// <summary>
/// 构造函数
/// </summary>
public LessonScore(string les, float scr)
{
this._Lessson = les;
this._Score = scr;
}
public override string ToString()
{
string str;
str = string.Format("{0}----{1}分", this._Lessson, this._Score);