CIS 380 Lab 5

Points: 50 Due Date: Wednesday February 5, 2003

And now for something completely different. This is not very related to the gradebook problem. We'll come back to that next time. This is practice creating and using classes and collections.

First the data. This is a file of names, your names to be exact. The file can be seen here and this is a sample.


You will need to create a class that holds a single name. It will have a firstname and lastname property. It will have methods to get and put the first and last names. It will also have methods to returns a string that contains the whole name, either first name first or last name first. The two parts of the name will be separated by commas. Note that the input data is in mixed case. When stored in a class instance, it will be changed to having the first letter of each part upper case and the rest in lower case. So, this

	ArchIE kent
is stored as
	firstname = Kent
	lastname = Archie 

Now you need a second class to hold a collection of these name objects. It will use the builtin collection class to hold the set of names. It will have properties like count that tells how many are in the collection. It is read-only. Other methods include

You may need other methods or properties to handle all the activities.

Here is a picture of the main form of the problem. lab 5 screen First the user clicks the load data button. If they try to do other things before hitting the load data button, they should be informed of an error. If they put a name (either first or last) in the text box, they can click one of the two buttons. This will start a search of the data in the collection for names that match the textbox contents, either first or last name. The names that match are presented in the list box at the right side.

They can then pick a name from the list box and click the delete button. This will do two things, it will remove the name from the collection and from the list box. Then they can save the data.

The executable may help clarify the requirements. Download the Zip file that contains the executable and data files . Yours does not have to look just like that. The position of the controls, their names or the labels on them is not the primary thing. ASK if you aren't sure what I mean or if you want to know if you are going in the right direction.


  1. Print, fill out and attach the cover sheet.
  2. Source Printout. All the needed output can be generated by selecting File from the VB menu bar. Then select Print. This displays a window, from which you should select to print the form image and the code.
    The source code must have your name in the comments as well as the lab name or number.
  3. Data Files
  4. Attach a printout of the original data file and the resulting one.


ASK if you have any questions.