Engine(engineCapacity:int, engineType:string)
i.e. engine capacity 1500, 1300 etc, engineType patrol, deisle, gas etc
Door(doorWeight: float, doorTransmission:string) , door weight 10.5, 25.2 KG etc, door transmission , automatic, manual
Wheel(diameter:int, type:string) 192 diameter etc and type is tubeless
So Think about all attributes for remaining.
and then below way is of coding step by step for all classes
1. create a class
2. Write attributes defined above as private
3. provide setter and getter for each and every attribute
Things to remember as best coding practice
a. Class name should be Capitalize means if it is single word start Capital if it is multiple word Start every word capital but no space for example if you name your class as AutmaticCar then A and C is capital.
b. all variable in clas should private and camle case which means if it is single word then small alphabet all if it is multi word then first word will be full small and rest all word should start with Capital for example
accountDeposit , remainingBalance, lastMonthSalary etc
c. function should be public and name of function rule should same as variable

Sponsored Links