CarClass.zip Started classes,
revisted the car facts lab for data to populate the
properties of an array of car objects. Recall we started
by going to menu Project/Add Class ...
The roster should have information like Number, Name, Position, Status, Height,
Weight, Birthdate (let's be brave a declare it as a Date), YearsExperience, and College.
Highlight that table of data and copy to an Excel spreadsheet. Save that spreadsheet
as a csv file. Open the file in Notepad and use Edit/Replace to replace all of the quotation
marks with nothing. Name will now be broken into FirstName and LastName. (Be on the lookout
for anyone who might be a Jr. Such a name can throw off our parsing.
While still on that site, steal a logo to dress up your form.
Make a class with properties aNumber, aFirstName. aLastName, aPosition, aStatus,
aHeight, aWeight, aBirthdate, aYearsExperience, aCollege.
Write Sets and Gets for those properties.
Include in your class a function that returns the FullName.
Include in your class a function that spells out the status symbol
(legend found at the bottom of the roster ACT = Active, RES = Injured reserve,
NON = Non football related injured reserve, SUS = Suspended,
PUP = Physically unable to perform, UDF = Unsigned draft pick, EXE = Exempt)
Declare an array of objects of your class. When the Form loads, read the file made above
parse it into lines, then instantiate the array of objects.
Put your logo on your Form as well as a ComboBox.
Loop through the lines, parsing the information on commas. Instantiate the individual
element as an object. Assign each its properties.
Use your fullname function to add names to a ComboBox.
Have a set of labels (for Number, FullName, Heigt and Weight, Position and Status (written out),
Birthdate and School) that display the information when the user chooses the name from the
ComboBox.