Advertisement
wingman007

OOPPrinciplesStatic1bStudent

Mar 19th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace World1b
  8. {
  9.     class Student : Person
  10.     {
  11.         private string fNumber;
  12.         public string FNumber
  13.         {
  14.             get { return fNumber; }
  15.             set { fNumber = value; }
  16.         }
  17.  
  18.         public Student()
  19.             :this("Default", 0, "")
  20.         { }
  21.         public Student(string name, int age, string fNumber)
  22.             :base(name, age)
  23.         {
  24.             this.fNumber = fNumber;
  25.         }
  26.  
  27.         public override void IntroduceYourSelf()
  28.         {
  29.             // onlyRead = 2.71 * age;
  30.             Console.WriteLine("I am student! ");
  31.             base.IntroduceYourSelf();
  32.             Console.WriteLine("My fNumber = {0}", fNumber);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement