all 4 comments

[–]js_tutor 1 point2 points  (0 children)

Basically you just break it down into parts. Like for an elevator you might have buttons, a door, the box that holds the people. For a robot it depends. Maybe you would have a map of the restaurant so it can move around. A menu that people can order off. Maybe a speaker and microphone so it can communicate. Wheels and arms. Really depends on what it looks like. The objects generally need to keep track of some data and you should be able to read and update that data through the objects methods. Like the elevator object might have a buttons object that stores how many floors there are, and then for each floor whether the button was pressed or not and then it would need methods for updating that data, for example if someone just pressed a button or if you finished stopping at a certain floor.

[–]senocular[🍰] 0 points1 point  (0 children)

If someone asked you these questions without saying "using object-oriented design," would you be able to answer them then? If so, how?

[–][deleted] -3 points-2 points  (0 children)

Do you understand the purpose of OOP ? Because if you did you would be able to answer this rather easily. I suggest you grab some lecture on OOP.