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
|
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)