AS computing

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.

Views: 3788

Attachments:

Reply to This

Replies to This Discussion

Public a, b, x, y, c As Integer
Public u, v As String

Private Sub Command1_Click()
u = InputBox(" enter the first value ")
a = Val(u)
v = InputBox(" enter the second value ")
b = Val(v)
If a = b Then Call square(u, v)
If a <> b Then Call rectangle(u, v)



End Sub

Function rectangle(ByVal x As Integer, ByVal y As Integer) As Integer
c = x * y
MsgBox (" the are of rectangle is = ") + Str(c)



End Function


Function square(ByVal x As Integer, ByVal y As Integer) As Integer
c = x * y
MsgBox (" the are of square is = ") + Str(c)
End Function
Public l, w, x As Integer
Public a, b As String
Private Sub Command1_Click()
a = InputBox(" enter length ")
l = Val(a)
b = InputBox(" enter width")
w = Val(b)
Call area(l, w)
If l = w Then Form1.Print "square with area=" + Str(x)
If l <> w Then Form1.Print "rectangle with area=" + Str(x)
End Sub
Function area(ByVal l As Integer, ByVal w As Integer)
x = l * w
End Function
Public u, v, a, b As Integer

Private Sub Command1_Click()
u = InputBox("insert value")
a = Val(u)
v = InputBox("insert value")
b = Val(v)
'Call ky (a,b)
'Form1.print area
Form1.Print ky(a, b)


End Sub
Function ky(ByVal x As Integer, ByVal y As Integer) As Integer

If a = b Then MsgBox ("square"): area = x * y
If a <> b Then MsgBox ("rectangle"): area = x * y

ky = area
MsgBox ("Area = ")

https://todaysmeet.com/Block6

Please try this link and lets have a chat engine setup for our block6.

Dr.Ravi

It's been a long time since we do some programming. Here's the program codes for entering 10 numbers in an array, and print out the difference between two successive number.

Dim a(10), d(10)

For i = 1 To 10
a(i) = InputBox("Please enter a number")
Next i

For i = 1 To 9
d(i) = a(i + 1) - a(i)
Next i

For i = 1 To 10
Print Abs(d(i))
Next i
Dim nama(10) As String
Dim jum(5) As Integer
Dim total(10) As Integer
Dim min(10) As Integer


For stud = 1 To 5

nom$ = InputBox("Name")
nama(stud) = nom$
For mark = 1 To 5
jom$ = InputBox("Marks")
jum(mark) = jom$
Next mark
b = 0
For ave = 1 To 5
a = jum(ave)
b = b + a
Next ave
c = b / 5
total(stud) = b
min(stud) = c

Next stud

For j = 1 To 5
List1.AddItem (nama(j))
List2.AddItem (total(j))
List3.AddItem (min(j))


Select Case min(j)
Case Is < 50
List4.AddItem ("Fail")
Case 50 To 79
List4.AddItem ("Pass")
Case 80 To 90
List4.AddItem ("Distinction")
Case 90 To 100
List4.AddItem ("First Class")
Case Else
List4.AddItem ("Invalid marks")
End Select

Next j

===========================================
Here's the image. idk why i cant attach. heres the link only:

http://i1276.photobucket.com/albums/y465/Ameer_da_Gilgamesh/siapa_z...
btw, i reduce the number of students from 10 to 5, just to fasten the test.

idk why i cant use the edit function :/

here's my answer for the question that u gave to us on 240114

This is the codes to indicate if a row is fully occupied with values (data) or not.

Dim box(8, 8)
Dim row(8) As Integer


For j = 1 To 8
For i = 1 To 8
MsgBox "Please input value for row " + Str(j) + ", column " + Str(i)
box(j, i) = InputBox("Please input value. Zero's and One's only. (0 or 1)")
Next i
Next j


For j = 1 To 8
For i = 1 To 8
If box(j, i) = 1 Then row(j) = row(j) + 1
Next i
Next j

For j = 1 To 8
If row(j) = 8 Then x = x + 1
Next j

MsgBox "The first " + Str(x) + " rows are fully occupied."
Print "The first " + Str(x) + " rows are fully occupied."
dim board(8,8) as integer

for i = 1 to 2
for j = 1 to 8
board(i,j) = 1
next j
next i
Subscribe via Email

17th March Homework/Assignment (:

==========================================================

Dim id(4), customid(4), bookid(4), orderdate(4), qtt(4), price(4) As Integer
Dim i, j, k, l, m, n As Integer

For i = 1 To 4
    id(i) = InputBox("id : " + Str(i))
    customid(i) = InputBox("customer id : " + Str(i))
    bookid(i) = InputBox("book id : " + Str(i))
    orderdate(i) = InputBox("orderdate : " + Str(i))
    qtt(i) = InputBox("quantity : " + Str(i))
    price(i) = InputBox("price : " + Str(i))
Next

'total amount
    j = 0
    k = 0
For j = 1 To 4
    n = qtt(j)
    k = k + n
Next

'top sales
    m = 0
For l = 1 To 4
    If bookid(l) > m Then
        m = bookid(l)
    Else
        m = m
    End If
Next

'print

print "Total order amount: " +str(k)

print "Book that is top seller: "+str(m)

==================================

tested and it works. 

Reply to Discussion

RSS

© 2025   Created by Ravichandran.   Powered by

Report an Issue  |  Terms of Service