Wednesday, February 18, 2009

Work Feb 18th.

Justin F - Period 1.

Comparison Operators:
1. If temperature > 75
Display temperature
endif
2. If GPA > 2.5
Display GPa
Else
Print “You Need to Improve your GPA”
endif

Comparison Operators:

1. If variable1 = variable2 Then
Condition = True
endif
2. If name <> Smith Then
Display allNames
endif
3. If taxRate > 7%
price * .99
Display taxRate
endif

Upper/Lower Methods:

1. nameSmith = nameSmith.ToLower()
2. nameSmith = nameSmith.ToUpper()

= equals
> greater than
>= greater than or equal
< less than
<= less than or equal
<> not equal to

Summary - Decision Structure or Selection structure is a structure comprised of If, If/Then, If/Then/Else, and Case structures. Each of these structures has a "true" path defined by the "condition" yet only some of them may contain a "false" path recognized my the operator "else". The operator "endif" represents the ending of the statement. If statements primarily use Comparison Operators or Relational Operators to define s true statement. These operators include =,<,>,<=,>=,and <>. The Upper method and the Lower methods are coding methods added to change a string from upper case to lower case or vice-versa.

No comments:

Post a Comment