R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented...
-
date post
21-Dec-2015 -
Category
Documents
-
view
215 -
download
2
Transcript of R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented...
![Page 1: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/1.jpg)
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
![Page 2: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/2.jpg)
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
![Page 3: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/3.jpg)
R. Ching MIS Department California State University, Sacramento
Add the class from the Project menuAdd the class from the Project menu
![Page 4: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/4.jpg)
R. Ching MIS Department California State University, Sacramento
Assign a name to the classAssign a name to the class
![Page 5: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/5.jpg)
R. Ching MIS Department California State University, Sacramento
Define the class’ Define the class’ propertiesproperties
![Page 6: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/6.jpg)
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
![Page 7: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/7.jpg)
R. Ching MIS Department California State University, Sacramento
![Page 8: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/8.jpg)
R. Ching MIS Department California State University, Sacramento
![Page 9: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/9.jpg)
R. Ching MIS Department California State University, Sacramento
ConstructorsConstructors
Add the Add the constructorsconstructors
![Page 10: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/10.jpg)
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
![Page 11: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/11.jpg)
R. Ching MIS Department California State University, Sacramento
Add the SubclassesAdd the Subclasses
![Page 12: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/12.jpg)
R. Ching MIS Department California State University, Sacramento
![Page 13: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/13.jpg)
R. Ching MIS Department California State University, Sacramento
Constructor Constructor (the same (the same for each for each class)class)
![Page 14: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/14.jpg)
R. Ching MIS Department California State University, Sacramento
Super and Super and SubclassesSubclasses
![Page 15: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/15.jpg)
R. Ching MIS Department California State University, Sacramento
Define the ObjectsDefine the Objects
Objects to classesObjects to classes
ObjectObject
ClassClass
![Page 16: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/16.jpg)
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
![Page 17: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/17.jpg)
R. Ching MIS Department California State University, Sacramento
![Page 18: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/18.jpg)
R. Ching MIS Department California State University, Sacramento
![Page 19: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/19.jpg)
R. Ching MIS Department California State University, Sacramento
Adding Shared VariablesAdding Shared Variables
![Page 20: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/20.jpg)
R. Ching MIS Department California State University, Sacramento
Read-only Read-only property property proceduresprocedures
![Page 21: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/21.jpg)
R. Ching MIS Department California State University, Sacramento
Temporary FixTemporary Fix
![Page 22: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/22.jpg)
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
![Page 23: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/23.jpg)
R. Ching MIS Department California State University, Sacramento
Test for the Selected ItemTest for the Selected Item
![Page 24: R. Ching MIS Department California State University, Sacramento Week 12 Object-Oriented Programming Base and Derived Classes Lab Exercise.](https://reader033.fdocuments.in/reader033/viewer/2022042821/56649d6d5503460f94a4d09f/html5/thumbnails/24.jpg)
R. Ching MIS Department California State University, Sacramento