Professional Documents
Culture Documents
20090108 - pcs (p) Bài tập C#
20090108 - pcs (p) Bài tập C#
Programming in C# Page 1 of 4
Question 1
I. Create an interface IStudent that has the following methods:
- double ScholarshipAmount(): calculate scholarship amount .
- void DisplayDetail(): display the information of Student.
II. Create a class Student inherits from interface IStudent.
1. Fields – Private:
2. Properties:
• string Name – Name of student: R/W. Length of Name from 6 to 40
characters.
• int Age – age of student: R/W. Value of Age from 10 to 100
• float Math – mark math of student: R/W. Value of Math from 0 to 10
• float English – mark English of student: R/W. Value of English from
0 to 10
• float Philosophy – mark philosophy of student: R/W. Value of
Philosophy from 0 to 10
• float Average –average mark of student: R
Average= ((Math+English+Philosophy)/3)
Note:
1. R/W: Read-write property.
2. R: Read property.
3. Methods:
Programming in C# Page 2 of 4
2. Methods:
- Override method DisplayDetail() to display information of student, and plus
mark.
- Override method ScholarshipAmount(), with average mark= average mark +
plus mark
1. Fields – Private:
2. Properties:
1. Create 2 Person
2. Create 1 PersonVietNam, then assign these Person into the array via
Indexer
3. Invoking the DisplayDetails method to display the PersonVietNam
details.
Programming in C# Page 3 of 4
-----THE END-----
Programming in C# Page 4 of 4