Class 6 - 12/4/09 Click to edit Master subtitle style Flow...

Info iconThis preview shows pages 1–9. 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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight 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: 12/4/09 Click to edit Master subtitle style Flow Control Matthew Hashim 9/10/2009 11 MGMT 290D 12/4/09 Goals n Use the Boolean type and its basic operations. n Use the if statement to perform some statements while skipping others. 22 MGMT 290D MGMT 290D 12/4/09 Flow Control n Flow: sequence of steps for performing a user story n Flow control statement: structure for managing flow n Flow control statements used in previous chapters doInOrder : produces a sequential execution doTogether : produces a parallel execution n Control statements introduced in the current chapter if : directs program flow along one of two paths for : directs flow into a fixed number of loops while : directs flow into an arbitrary number of loops 33 MGMT 290D MGMT 290D 12/4/09 Flow Control (continued) 44 MGMT 290D MGMT 290D 12/4/09 The Boolean Type n A basic Alice type used to define Boolean variables n A Boolean variable holds a value of true or false n Other basic types: Number and Object n Condition (Boolean expression) Produces a value of true or false Basis for decision-making in programs 55 MGMT 290D MGMT 290D 12/4/09 Boolean Functions n Return a value of true or false n Can act as a condition in an if or while statement n Many refer to an objects bounding box n Example: obj .isBehind( obj2 ) true , if obj s position is beyond obj2 s rear edge false , otherwise 66 MGMT 290D MGMT 290D 12/4/09 Boolean Variables n Used to store a value of true or false n Can be used in condition for if or while statement n How to create a Boolean variable Click create new variable (or parameter ) button Specify Boolean as variable (or parameter) type 77 MGMT 290D MGMT 290D 12/4/09...
View Full Document

Page1 / 29

Class 6 - 12/4/09 Click to edit Master subtitle style Flow...

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

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