{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter 4 Summary

# Chapter 4 Summary - Chapter 4 Summary Chapter 4 Making...

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

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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online