Programming Constructs Flashcards
1
Q
Pre-Defined Functions
3
A
- Random
- Round
- Length
2
Q
Standard Algorithms
3
A
- Input Validation
- Running Total
- Traversing an Array
3
Q
Pre-Defined Functions
Random
A
num = Rnd() * 10
Generates random number between 0 and 10
4
Q
Pre-Defined Functions
Round
A
num = math.round(3.14, 1)
Rounds number to 1 decimal place
5
Q
Pre-Defined Functions
Length
A
Num = len(name)
Value becomes number of letters in name variable
6
Q
Standard Algorithms
Input Validation
A
Do while num > 10
MsgBox(“Error, the number you enter should be equal to or less than 10.)
num = InputBox(“Please enter a number”)
Loop
7
Q
Standard Algorithms
Running Total
A
Total = 0
For counter = 1 to 3
Num = InputBox(“Please enter a number)
Total = Total + Num
Next
8
Q
Standard Algorithms
Traversing an Array
A
For counter = 0 to 3
MsgBox(array(counter))
Next