{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# DQ1 Week 3 IT210 Answer - statements has been tested(Venit...

This preview shows page 1. Sign up to view the full content.

Deciding which algorithm to use to write a simple task like “making a peanut butter sandwich is  actually the hardest part of creating that algorithm. The three control structures are decision, loop, and  sequential. To simplify this process the first step is to determine which problem the algorithm describes. The  input in this case is two slices of bread, a knife, and some peanut butter. A peanut butter sandwich is the  desired outcome. To begin, I need to choose whether the sequential structure of a series of consecutive statements, after  the one-two-three order, will solve this task (Venit, 2004, p. 45). I could also use the loop structure, to repeat  the looking until a true or false result is reached (Venit, 2004, p. 45). My last option is to use the decision  structure to test a number of these statements, and then change to a different method when that block of
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: statements has been tested (Venit, 2004, p. 45). This is not a difficult process. I could use any of the three control structures to reach this result, but I would choose the sequential structure. The sequential structure will make things simple, because it does not involve complexities like branch point statements in the simple process of sandwich-creation (Venit, 2004, p. 45). Thos algorithm will carry out some statements, and then end. All together, deciding on the right control structure to create a peanut butter sandwich can be direct and easy. From the sequential, loop, and decision structures, all of them will eventually solve the problem. Reference Venit, S. (2004). Extended prelude to programming: Concepts and design (2 nd ed). Boston: Scott/Jones....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online