Maybe the concept is incorrect? When I go back to read books in the evening, you are also welcome to help me :) using system;
Using system. Collections. Generic;
Using system. text;
Namespace generator Mode
{
Class Program
{
Static void main (string [] ARGs)
{
Try
{
// You must study for further studies
Students A = new ();
// Of course, you must pass the examination
New Test (Children );
Kid A. Successful ();
}
Catch (exception ex)
{
Console. writeline (ex. Message );
}
Console. Read ();
}
}
Interface for further studies
{
Double Language score
{Get; set ;}
Double mathematical score
{Get; set ;}
Double Foreign Language score
{Get; set ;}
Void ();
}
Class learning: Further Studies
{
Double Language = 0;
Double mathematics = 0;
Double Foreign Language = 0;
Public double Chinese score
{
Get
{
Return language;
}
Set
{
Language = value;
}
}
Public double mathematical score
{
Get
{
Return mathematics;
}
Set
{
Mathematics = value;
}
}
Public double foreign language score
{
Get
{
Return foreign language;
}
Set
{
Foreign Language = value;
}
}
Public void ()
{
If (Language <60)
{
Throw new exception ("fail in Chinese, do not want to go to school ");
}
If (Mathematics <60)
{
Throw new exception ("fail in mathematics, don't want to go to school ");
}
If (Foreign Language <60)
{
Throw new exception ("Foreign Language failed, don't want to go to school ");
}
Console. writeline ("I finally succeeded ");
}
}
Class Test
{
Daily Study;
Private exam ()
{}
Public exam (daily study)
{
This. Daily learning = daily learning;
Final Exam ();
}
Void final exam ()
{
Random RD = new random ();
Study every day. Mathematical score = (double) RD. Next (1,100 );
Study every day. Foreign Language score = (double) RD. Next (1,100 );
Daily study. Chinese score = (double) RD. Next (1,100 );
}
}
}