r. ching mis department california state university, sacramento week 12 object-oriented...
Post on 21-Dec-2015
216 views
TRANSCRIPT
R. Ching MIS Department California State University, Sacramento
Week 12Week 12Object-Oriented Object-Oriented ProgrammingProgramming
Base and Derived ClassesBase and Derived Classes
Lab ExerciseLab Exercise
R. Ching MIS Department California State University, Sacramento
StepsSteps
• Create the classCreate the class
• Define the propertiesDefine the properties
• Create the accessor methodsCreate the accessor methods
• Create the constructorsCreate the constructors
• Create the formCreate the form
• Create the derived classesCreate the derived classes
R. Ching MIS Department California State University, Sacramento
Add the class from the Project menuAdd the class from the Project menu
R. Ching MIS Department California State University, Sacramento
Assign a name to the classAssign a name to the class
R. Ching MIS Department California State University, Sacramento
Define the class’ Define the class’ propertiesproperties
R. Ching MIS Department California State University, Sacramento
Accessor MethdodsAccessor Methdods
Add the accessor Add the accessor methodsmethods
Tests the length Tests the length of the character of the character stringstring
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
ConstructorsConstructors
Add the Add the constructorsconstructors
R. Ching MIS Department California State University, Sacramento
Create the FormCreate the Form
Text boxesText boxes
Combo boxCombo box
Text boxText box
Group boxGroup box
Radio buttonsRadio buttons
ButtonsButtons
List boxList boxLabelsLabels
R. Ching MIS Department California State University, Sacramento
Add the SubclassesAdd the Subclasses
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
Constructor Constructor (the same (the same for each for each class)class)
R. Ching MIS Department California State University, Sacramento
Super and Super and SubclassesSubclasses
R. Ching MIS Department California State University, Sacramento
Define the ObjectsDefine the Objects
Objects to classesObjects to classes
ObjectObject
ClassClass
R. Ching MIS Department California State University, Sacramento
Button ClickedButton Clicked
Find the Find the checked radio checked radio buttonbutton
Instantiate Instantiate the objectthe object
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
Adding Shared VariablesAdding Shared Variables
R. Ching MIS Department California State University, Sacramento
Read-only Read-only property property proceduresprocedures
R. Ching MIS Department California State University, Sacramento
Temporary FixTemporary Fix
R. Ching MIS Department California State University, Sacramento
When the user selects an item in the list box, When the user selects an item in the list box, the corresponding counts appear in the labelsthe corresponding counts appear in the labels
R. Ching MIS Department California State University, Sacramento
Test for the Selected ItemTest for the Selected Item
R. Ching MIS Department California State University, Sacramento