Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DebugSession:
- Following changes were made to the code to remove the existing bug:
- 1) Class object was not initialized correctly -
- TotalClass totalClass = new TotalClass();
- 2) The node from XML DOM wasn't accessed correctly -
- studentList = studentData.SelectNodes("//STUDNT");
- 3) The switch case does not consider "f" and "m" values.
- 4) In TotalClass.cs, variables "Males" and "Females" are initialized with -1. It should be initialized with 0.
- —————————————————————————————————————————————————-------------------------------------------------------------------
- Sorter:
- Form1.cs - contains the logic of file reading, name list sorting and writing inside method "btnRun_Click".
- Person.cs - contains two classes
- Person - POJO containing the first name and last name of the person.
- PersonNameComparer - Comparer used to sort the objects in the list based on the last name. If the last name is the same, then it sorts by the first name.
- Exception handling - used in Form1.cs (handles File not found exception)
- Assumption - The names with no last names would come first.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement