IfIf ThenIf Then Else Decision Structures - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

IfIf ThenIf Then Else Decision Structures

Description:

At a certain time... Under certain conditions... When certain conditions are met... Are conditions met? Yes, then do one thing. No, then do another thing. ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 14
Provided by: lanceco2
Category:

less

Transcript and Presenter's Notes

Title: IfIf ThenIf Then Else Decision Structures


1
IfIf ThenIf Then ElseDecision Structures
  • Molloy College
  • Mathematics and Computer Science
  • Dr. Cohen

2
If
3
If What does if mean? At a certain
time Under certain conditions When certain
conditions are met Not always
4
Usually If means a Boolean outcome Are
conditions met? Yes, then do one thing. No, then
do another thing.
5
If intSecret 24 Then lblMessage.captionYou
guessed the secret. End if If intSecret 20
Then lblMessage.captionWrong! Try again. End
if
6
  • Your book lists Boolean relational operators
  • equal to
  • lt less than
  • lt less than or equal to
  • gt greater than
  • gt greater than or equal to
  • ltgt unequal to

7
If Then statements can handle more than one
line If intSecret 24 Then lblMessage.captionY
ou are right! lblMessage.fontsize24 lblMessage.f
ontArial End if
8
As an alternative use Else If intSecret24
Then lblMessage.captionVery good! Else lblMessa
ge.captionSorry. Try again. End if
9
Message Boxes
Message Boxes are used frequently with decision
structures. Youve seen message boxes almost
every time you access the Internet.
10
(No Transcript)
11
To create a Message Box, use this simple formula
MsgBoxMsg MsgBoxPut in the message you want.
12
Generating Random Numbers
13
With random numbers we can simulate changing
values.
Write a Comment
User Comments (0)
About PowerShow.com