-------------------------------------------------
Week Four
Structured Programming, Part II
* Demonstrate the iteration control structure. * Design complex program algorithms using the three basic control structures. ------------------------------------------------- Course Assignments 1. CheckPoint: Iteration Control Structure
DUE: Friday (Day 5)
* Design a program that models the worm’s behavior in the following scenario:
A worm is moving toward an apple. Each time it moves, the worm cuts the distance between itself and the apple by its own body length until the worm is close enough to enter the apple. The worm can enter the apple when it is within a body length of the apple.
2. Assignment: …show more content…
* Create test data to validate that algorithms handle user input data correctly. ------------------------------------------------- Course Assignments 1. CheckPoint: Algorithm Verification
DUE: Friday (Day 5)
* Answer the following questions about the information in Appendix J:
* What will be printed if the input is 0? * What will be printed if the input is 100? * What will be printed if the input is 51? * What will be printed if the user enters “Wingding”? * Is this design robust? If so, explain why. If not, explain what you can do to make it robust. * How many levels of nesting are there in this design? * Provide a set of values that will test the normal operation of this program segment. Defend your choices. * Provide a set of test values that will cause each of the branches to be …show more content…
If you consider a kitchen, you see it is also composed of several, smaller components, including the oven, refrigerator, and microwave. Top-level objects are composed of smaller components that do the actual work. This perspective is a very natural way of looking at our world, and one with which we are all familiar. We do the same thing in object-oriented programming:
* Identify components that perform a distinct service * Encapsulate all the items in the component necessary to get the job done * Identify the messages that need to be provided to the other components Although the details can be quite complex, these details are the basic principles of object-oriented programming.
* Consider the microwave oven in your kitchen, using the object-oriented thinking described