Identify a task you perform regularly

Identify a task you perform regularly - Declare bag as real...

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

View Full Document Right Arrow Icon
Identify a task you perform regularly I think I will use feeding my dogs in this task. Write a short, structured design (pseudocode only) that accomplishes this task. Declare dog food as real Declare bag the food in is real Declare knife is real Declare bowl as real Pick up knife Cut open bag Put knife back Pick up bowl Put bowl in bag scoop up dog food in bowl Put bowl back on floor Close dog food bag End program Think about this task in an object-oriented way, and identify the objects involved in the task . This is pretty simple there s not many objects involve in feeding the dogs. There is the dog food which the dogs eat, there is the bag that needs opened to get the food, there is the knife to open the bag, and the bowl to put the food in. Identify how you can encapsulate the data and processes you identified into an object-oriented design Class dog feedong operations Declare dog food as real Declare knife as real
Background image of page 1

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

View Full DocumentRight 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: Declare bag as real Declare bowl as real Sub program feed dogs Set get knife = open bag Put knife back End sub program Sub program feeding Pick up bowl Use bowl to scoop food in bowl Put bowl down End program Function get knife ()as real Set get knife as open dog food bag End function Function get dog bowl ()declare as real Set get bowl = scoop dog food out Set function set dog food down End function End program Describe the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why? A modular approach starts with determining the major tasks as object orientation determines the major tasks. They both make a fair amount of sense to me though I can see how one may be better than the other under certain circumstances and programing needs or just the programmers preferances toward porograms...
View Full Document

Page1 / 2

Identify a task you perform regularly - Declare bag as real...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online