Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SYATP2_2
- {
- [Serializable]
- public class Student
- {
- public string name;
- public string lastname;
- public string faculty;
- public string Name
- {
- get
- { return name; }
- set
- {
- name = value;
- }
- }
- public string Lastname
- {
- get
- { return lastname; }
- set
- {
- lastname = value;
- }
- }
- public string Faculty
- {
- get
- { return faculty; }
- set
- {
- faculty = value;
- }
- }
- public Student()
- {
- Name = "";
- Lastname = "";
- Faculty = "";
- }
- public virtual List<(string,string)> getField()
- {
- return new List<(string, string)> {("Name", Name),("Lastname", Lastname),("Faculty", Faculty) } ;
- }
- public Student(string n, string l, string f)
- {
- Name = n;
- Lastname = l;
- Faculty = f;
- }
- public override string ToString()
- {
- return $"Имя = {Name}, фамилия = {Lastname}, факультет = {Faculty}";
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SYATP2_2
- {
- public class Master:Student
- {
- public string diplomaNumber;
- public string DiplomaNumber
- {
- get
- { return diplomaNumber; }
- set
- {
- diplomaNumber = value;
- }
- }
- public override List<(string, string)> getField()
- {
- return new List<(string, string)> { ("Name", Name), ("Lastname", Lastname), ("Faculty", Faculty), ("DiplomaNumber" , DiplomaNumber)};
- }
- public Master() : base()
- {
- DiplomaNumber = "";
- }
- public Master(string n, string l, string f, string d):base(n,l,f)
- {
- DiplomaNumber = d;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement