Chapter 4 Summary - Chapter 4 Summary Chapter 4: Making...

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

View Full Document Right Arrow Icon
Chapter 4 Summary Chapter 4: Making Decisions 4.1 Decision Structure The decision structure allows a programs logic to have more than one path Up to now, all we have experienced is sequential execution of stmts. In this chapter, we can take different paths. 4.2 The If….Then Statement The if then stmt will only executive given that the “if” portion is true. The stmt takes the form of: If expression then Stmt End if If the “If” portion is not true, the statement does not execute. Relational operators can be used: < > = >= <= <> Relational and math operators may be combined: If intA + intB > 100 then Messagebox.show(“good job”) End if
Background image of page 1

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

View Full DocumentRight Arrow Icon
The If….Then….Else Statement allows the statement to truly branch – one way for given condition and another way for others. The format is If expression then Stmt Else Stmt End if In practice this would appear as: If score > 90 then Messagebox.show(“excellent!”) Else Messagebox.show(“good job”) End If 4.4 The If….Then….ElseIF Statement This provides for the possibility of multiple Else statements. The format is: Multiple Else statements can be included here. If expression then
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/30/2011 for the course BUS 92 taught by Professor Staff during the Spring '11 term at San Jose State University .

Page1 / 6

Chapter 4 Summary - Chapter 4 Summary Chapter 4: Making...

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

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