Starting from:
$30

$24

Lab 4 Solution




For this lab you’ll be working on function design, specification, and testing by systematically working through the six step process laid out in chapter 3.




The Lab




First things first, now that you have a bit of experience defining func-tions, let’s go back to the beginning and see if we can’t gain some new perspective.




1. Read/Re-read the section titled Systematic Program Design in the Preface of the text and take careful note of the steps listed in Fig-ure 1.




We briefly covered the design recipe process in class this morning. You’ll now practice on some simple functions. At this point we’re skipping step 4, Function Templates, from the preface, so you only need to do steps 1-3 and 5-6. Do not skip steps. Do not do them out of order. The functions you’re asked to design are simple and famil-iar because the point is for you to focus on the recipe and proper specification. The end product should look the code you see in Figure 17 in section 3.5, but what you see will shift and change as you work the process.




2. Do exercises 34 to 38 in section 3.2




Once you’ve completed the exercises, print them and turn them in. If you have questions about functions, function definitions, and function design, then now is a good time to ask them.




Reading Homework




Go read Section 2.5 and Section 3.6. You’ll soon be given your first programming project and these chapters are about putting functions together to make a complete program. They’re incredibly important and merit extra close study both in and out of class.

More products