Hi,
I am learning C#. As part of my assignment. We have to create a console and windows form for a student and teacher. I have finished coding and program works well in the console.
When I created a test program for console I have created two switch menus one for student and another for teacher(I have base class as Person, Employee for teacher and so on) and I have two of each add, remove, show, find methods(I have created static private list for student and teacher). One set of methods for student and another set for teacher. The Student class and Teacher class have properties and constructors only.
I am wondering if this is right approach. Should I have only one menu and one add, remove, show, find methods ? If so how would I differentiate between what the user is asking( I will be using a lot of if else statements in that case).
Should have all these methods in their respective classes and create a list there instead of the test program?
Our professor has told us it is bad programming practice to use console.writelines in methods of class rather put them in test class.
I am totally confused and in doubt about my approach as my test class is huge with so many lines of code.
Please help.
I am learning C#. As part of my assignment. We have to create a console and windows form for a student and teacher. I have finished coding and program works well in the console.
When I created a test program for console I have created two switch menus one for student and another for teacher(I have base class as Person, Employee for teacher and so on) and I have two of each add, remove, show, find methods(I have created static private list for student and teacher). One set of methods for student and another set for teacher. The Student class and Teacher class have properties and constructors only.
I am wondering if this is right approach. Should I have only one menu and one add, remove, show, find methods ? If so how would I differentiate between what the user is asking( I will be using a lot of if else statements in that case).
Should have all these methods in their respective classes and create a list there instead of the test program?
Our professor has told us it is bad programming practice to use console.writelines in methods of class rather put them in test class.
I am totally confused and in doubt about my approach as my test class is huge with so many lines of code.
Please help.
