Type these in and make them work…

advertisement
Type these in and make them work…
1. For Counter = 6 to 10
2.
Print Counter
3.
If Counter < 3 then
4.
For BMX = 1 to 5
5.
LstBx1.items.add( BMX * Counter)
6.
Next BMX
7.
End if
8. Next Counter
9.
LstBx1.items.add (“Done”)
1.
2.
3.
4.
5.
6.
For a = 1 to 5
For z = 0 to 12
LstBx1.items.add (a & “x” & z & “=”& a*z)
Next z
LstBx1.items.add (“Time Tables” & a)
Next a
Sum Of Odd numbers 50- 100:
TheSum = 0
For CNT = 51 to 100 step 2
TheSum = TheSum + CNT
Next CNT
Msgbox( TheSum)
1
2
Multiplication Table of 5 from 0 to 100:
For cnt = 0 to 100
LstBx1.items.add (cnt & “ * 5 = “ & cnt * 5)
Next cnt
What is the purpose of the & sign? ‘
Rather than the 5 times table allow the user to Input what times table they want and what range (5 to 10)
Try this code:
For CNT = 1 to 10
Picture1.Top = Picture1.top + CNT
Picture1.left = Picture1.Left +CNT
Next CNT
What happens to your PICTURE1? Can you make it move in to opposite direction?
Conditional Loop
PassWord = “Hello”
Attempt =0
Do Until MyWord = Password
MyWord = inputbox(“Enter a password”)
If Attempt = 5 then
Listbox1.items.add( “too many tries”)
Exit loop
End if
Attempt = Attempt +1
loop
1
a Create a program to calculate the average mark of 10 students
b Average of the passing students only
c. Count the number of students that fail
d. Allow the teacher to enter marks for as many students as needed and to type -99 when they are done
Download