Week 12 ObjectOriented Programming Base and Derived Classes
Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise R. Ching MIS Department California State University, Sacramento
Steps • • • Create the class Define the properties Create the accessor methods Create the constructors Create the form Create the derived classes R. Ching MIS Department California State University, Sacramento
Add the class from the Project menu R. Ching MIS Department California State University, Sacramento
Assign a name to the class R. Ching MIS Department California State University, Sacramento
Define the class’ properties R. Ching MIS Department California State University, Sacramento
Accessor Methdods Add the accessor methods Tests the length of the character string R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
Constructors Add the constructors R. Ching MIS Department California State University, Sacramento
Create the Form Text boxes Combo box Text box Radio buttons Group box Buttons List box Labels R. Ching MIS Department California State University, Sacramento
Add the Subclasses R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
Constructor (the same for each class) R. Ching MIS Department California State University, Sacramento
Super and Subclasses R. Ching MIS Department California State University, Sacramento
Define the Objects to classes Class Object R. Ching MIS Department California State University, Sacramento
Button Clicked Find the checked radio button Instantiate the 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 Variables R. Ching MIS Department California State University, Sacramento
Read-only property procedures R. Ching MIS Department California State University, Sacramento
Temporary Fix R. Ching MIS Department California State University, Sacramento
When the user selects an item in the list box, the corresponding counts appear in the labels R. Ching MIS Department California State University, Sacramento
Test for the Selected Item R. Ching MIS Department California State University, Sacramento
R. Ching MIS Department California State University, Sacramento
- Slides: 24