Assignment 5 style

Assignment 5 style - Changes to the design recipe to...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Changes to the design recipe to accommodate mutation Mutation allows for functions to do more than algebraic manipulation of their arguments. In particular, a function can change the value of a variable, or can have other side-effects. This is explored in some depth in Section 36.4 of How to Design Programs . These are the elements of the modified design recipes for programs using mutations: State variables are the way that we store the values which may change over the execution of a program. For these variables, if they exist, define them and give them a value. (The state variables used in Assignment 5 are provided in the interface file.) The contract should describe the consumed value(s) and the produced value(s) of the func- tion. Use ( void ) to indicate that the function has no consumed values, and use ( void ) to indicate the function has no produced values. The purpose of a function should describe what the function consumes and produces....
View Full Document

Page1 / 3

Assignment 5 style - Changes to the design recipe to...

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