{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Object Oriented Data and Processes

Object Oriented Data and Processes - Set Drive Car = Start...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Data and Processes Declare Car Door as Real Declare Car as Real Declare Brake Pedal as Real Declare Drive as Real Open Car Door Sit in Car Close CarDoor Press BrakePedal Start Car Put car in Drive Release BrakePedal Accelerate Car End Program The objects involved in this task include the person that is going to drive the car and the car itself. The properties of the car include a door with a handle that is composed of metal, plastic and glass. The whole car is composed of four tires made of rubber and rims made of metal. The rest of the car is composed of rubber, plastic, glass and metal. The metal is made of many different types which may include aluminum, copper, and steel. Class Car Operation Declare Car as Real Declare Car Entry as Real Declare Car Driver as Real Subprogram Enter Car Set Enter Car = Open Car Door Get into Car Close Car Door End Subprogram Subprogram Drive Car
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Set Drive Car = Start Car Put Car in Drive Release Brake Pedal Accelerate Car End Subprogram Function Enter Car () as Real Set Enter Car = Car Entry End Function Function Drive Car () as Real Set Drive Car = Car Driver End Function End Class A programmer using the top-down, modular approach to program design begins by determining fundamental tasks. An object-oriented programmer, on the other hand, determines the fundamental objects associated with a problem. Structured designs make more sense to me because that’s what we have been working with during this entire class and have experience with it. However, I do see the major advantages of object-oriented programming. Over time, with experience, I am sure object oriented programming will make more since. I have gotten my feet wet with programming and have a lot to learn, but I am off to a good start....
View Full Document

{[ snackBarMessage ]}