Write C# code to perform the following: Create TrainingStudent class & implement variables, make sure about traiffPoint input range using TraiffPoint property. Create two constructors as follows: [both constructors should increment the class variable appropriately] The first is a default constructor that has no parameters and sets the instance variables to either "not known" for the strings, 20 for the integer. The second takes 3 parameters, one for each of the instance variables. Create ShortTraining & LongTraining classes (extending TrainingStudent) & implement variables month & year & make sure about Month & Year range inside property. After Implementation Verify & validate your Logic using following main Code. TrainingStudent t = new TrainingStudent(); t.Print(); // Not Known – Not Known – 20TP TrainingStudent t2 = new TrainingStudent(“12”, “akram”,150); t2.Print(); // 12 – akram – 150TP ShortTraining st = new ShortTraining(“13”, “rehman”,18,5); st.Print(); // 13 - rehman – 18TP – 5 Months ShortTraining st2 = new ShortTraining(“15”, “rehman”,110,5); st2.Print(); // 15 – rehman – 110TP – 5 Months LongTraining lt = new LongTraining(); lt.Print(); // Not Known – Not Known – 20TP – 1 year
Write C# code to perform the following:
- Create TrainingStudent class & implement variables, make sure about traiffPoint input range using TraiffPoint property.
- Create two constructors as follows: [both constructors should increment the class variable appropriately]
- The first is a default constructor that has no parameters and sets the instance variables to either "not known" for the strings, 20 for the integer.
- The second takes 3 parameters, one for each of the instance variables.
- Create ShortTraining & LongTraining classes (extending TrainingStudent) & implement variables month & year & make sure about Month & Year range inside property.
After Implementation Verify & validate your Logic using following main Code.
TrainingStudent t = new TrainingStudent(); t.Print(); // Not Known – Not Known – 20TP TrainingStudent t2 = new TrainingStudent(“12”, “akram”,150); t2.Print(); // 12 – akram – 150TP ShortTraining st = new ShortTraining(“13”, “rehman”,18,5); st.Print(); // 13 - rehman – 18TP – 5 Months ShortTraining st2 = new ShortTraining(“15”, “rehman”,110,5); st2.Print(); // 15 – rehman – 110TP – 5 Months LongTraining lt = new LongTraining(); lt.Print(); // Not Known – Not Known – 20TP – 1 year
|
Step by step
Solved in 3 steps with 1 images