class Student
{
public double _chineseScore;
public double _mathScore;
public double _englishScore;
public string _name;
public char _chineseLevel;
public char _mathLevel;
public char _englishLevel;
public Student()
{
}
public Student(
string _name,
double _chineseScore,
double _mathScore,
double _englishScore)
{
this._chineseScore = _chineseScore;
this._mathScore = _mathScore;
this._englishScore = _englishScore;
this._name = _name;
}
public void ShowInformation()
{
Console.WriteLine(
"语文{0}分,数学{1}分,英语{2}分", _chineseScore, _mathScore, _englishScore);
}
public void ShowStudentInfo()
{
Console.WriteLine(
"{0}:\t语文{1}分\t数学{2}分\t英语{3}分\t总分为:{4}\t平均分为:{5}", _name, _chineseScore, _mathScore, _englishScore, SumScore(), Average());
}
public char Level(
double score)
{
switch ((
int)score /
10)
{
case 10:
return 'A';
case 9:
return 'A';
case 8:
return 'B';
case 7:
return 'C';
case 6:
return 'D';
case 5:
case 4:
case 3:
case 2:
case 1:
return 'E';
default:
return ' ';
}
}
public double SumScore()
{
return _chineseScore + _mathScore + _englishScore;
}
public double Average()
{
return SumScore() /
3;
}
}
class Program
{
static void Main(
string[] args)
{
Random r =
new Random();
Student[] stu =
new Student[
10];
for (
int i =
0; i < stu.Length; i++)
{
stu[i] =
new Student(
"小茗" + i , r.Next(
50,
101), r.Next(
70,
101), r.Next(
80,
101));
}
Show(stu);
Console.ReadKey();
}
}