Cie AS Computing
Dear students of Block 6 AS computing, welcome to the computing class. I am your facilitator Dr.Ravichandran ( you can call me Dr.Ravi), I will be your course facilitator for AS computing and A2 computing. I will start communicating with you in this discussion forum - where you can start posting your queries and useful resources.
You are highly encouraged to interact with me and also with your peers as the class begins from 30th July 2013.
All the best and keep moving. Do not hesitate to ask and send your queries if you have one.
Regards,
Dr.Ravichandran
i HAVE ATTACHED THE SYLLABUS TOO.
YOU CAN DOWNLOAD THE ATTACHMENT FILE.
Tags:
Here's the link to the notes:
https://sites.google.com/site/computing9691/
Finally! We are starting to learn more programming! :D :D :D
Btw, we were asked to write a program to find the biggest digit from a given number (Note that the number can be as long as 255 characters :D )
Here's the program!
MsgBox "Hello! This is a programme to find the biggest digit from a given number!"
a = InputBox("Please input your number")
n = Len(a)
big = Mid$(a, 1, 1)
For i = 2 To n
If big < Val(Mid$(a, i, 1)) Then big = Val(Mid$(a, i, 1))
Next i
MsgBox "The biggest digit from the number you entered is " + Str(big): End
Thanks Ariel, That should be useful to others.
Ravi
[FIXED]
big = 0
For j = 1 To 10
a$ = InputBox$("num")
n = Len(a$)
p = 0
For i = 1 To n
b = Mid$(a, i, 1)
If (b / 2) = Int(b / 2) Then p = p + 1
If i = n Then Print "even for " + Str(a) + " = " + Str(p)
If big < Val(p) Then big = Int(p)
Next i
Next j
Print "Biggest even" + Str(big)
[nested loop, finding the biggest even numbers contained]
suhen the bosz contributed soooooo much :*
finding the no. with the most even digit (done)
Private Sub Command1_Click()
e = 0
For i = 1 To 10
p = 0
a = InputBox(" insert no.")
For n = 1 To Len(a)
b = Mid$(a, n, 1)
c = Val(b)
If c / 2 = Int(c / 2) Then p = p + 1
Next n
MsgBox "the no. with the most even digit is=" + Str(s): End
End Sub
If p > e Then e = p: s = Val(a)
Next i
big = 0
For n = 1 To 5
a = InputBox(" enter the number ")
b = Len(a)
For i = 1 To b
c = Mid$(a, i, 1)
d = Val(c)
If d / 2 = Int(d / 2) Then p = p + 1
Next i
If big < p Then big = p: s = a
p = 0: i = 0
Next n
MsgBox (" the number with more even digit is = ") + Str$(s): End
Sad to say that my program failed. Had to use Dr. Ravi's example. Btw, nice job Ameer & Syed :D
Private Sub Command1_Click()
MsgBox "Hello all! This is the program to find which number that you have inserted, up to 10 numbers, that has the most number of even digits."
big = 0
For n = 1 To 10
a = InputBox("Please enter the numbers, up to 10 numbers")
b = Len(a)
20 i = i + 1
c = Mid$(a, i, 1)
d = Val(c)
If d / 2 = Int(d / 2) Then p = p + 1
If i = b Then GoTo 100
GoTo 20
100 If big < p Then big = p: s = a
p = 0: i = 0
Next n
MsgBox "The term with the most even numbers is" + Str(s): End
End Sub
my program on problem to find the number with most number of even digits:
Private Sub Command3_Click()
For i = 1 To 3
a = InputBox("enter number")
n = Len(a)
For b = 1 To n
c = Mid$(a, b, 1)
d = Val(c)
If d / 2 = Int(d / 2) Then p = p + 1
Next b
If p > e Then e = p: big = a
p = 0
Next i
MsgBox "most even in " + Str(big)
End
[first :3]
[fixed]
For n = 1 To 20
For j = 1 To 10
g = n * j
Print Str(j) + " x " + Str(n) + " = " + Str(g)
Next j
Print
If (n / 2) = Int(n / 2) Then
Form1.ForeColor = vbGreen
Else
Form1.ForeColor = vbBlue
End If
Form1.FontSize = n
MsgBox "cls"
Form1.Cls
Next n
Today we learned how to create a multiplication table!
Thanks to Ameer for the help! He's a pro! :D
Private Sub Command1_Click()
For i = 1 To 20
For j = 1 To 16
x = i * j
Print Str(i) + " x" + Str(j) + "=" + Str(x)
Next j
MsgBox "Next multiple"
Form1.Cls
Next i
End Sub
It works :D
For n = 1 To 20
For j = 1 To 10
g = n * j
Form1.FontSize = 25
If n / 2 = Int(n / 2) Then Form1.ForeColor = vbBlue Else Form1.ForeColor = vbRed
Print Str(j) + " x " + Str(n) + " = " + Str(g)
Next j
Print
MsgBox "multiple of " + Str(n)
Form1.Cls
Next n
This is the multiplication table programming code, which I showed you in class.
For i = 1 To 20
For j = 1 To 16
Form1.FontSize = "17"
If j / 2 = Int(j / 2) Then Form1.ForeColor = vbRed
If j / 2 <> Int(j / 2) Then Form1.ForeColor = vbGreen
Form1.Print i; "*"; j; " = "; i * j
Next j
MsgBox "clear the screen"
Form1.Cls
Next I
© 2025 Created by Ravichandran.
Powered by