AS computing

Cie AS Computing

Dear all,

            Welcome to AS computing class. I am Dr.Ravi your facilitator for this course. This course consists of two modules, theory and practicals. In theory we will have 12 chapters and in practicals we do have programming classes. You will sit for theory and practical exams at the end of the course, which is conducted by CIE.

All the best, keep moving, for there is always a helping hand above you to guide you.

Dr.Ravi

 

Views: 3404

Reply to This

Replies to This Discussion

Assignment

















P BIG a(P) P=P+1 if BIG < a(P) BIG = a(P) Output
1 37 a(2) 2 TRUE a(2) 74

74 a(3) 3 FALSE a(2) 74

74 a(4) 4 FALSE a(2) 74

74 a(5) 5 FALSE a(2) 74



a(1) 37
a(2) 74
a(3) 54
a(4) 48
a(5) 18







MOhamed Faiz






7080



Assignment
Attachments:

Assignment- Tracing the output( Given Numbers: 37, 74, 54, 48, 18

 

P  

Big

   a(P)  

If Big < a(P)

Big=a(P)

Output

1

37

a(1)

 

 

 

2

37

a(2)

37<74

True

74

 

3

74

a(3)

74<54

False

74

 

4

74

a(4)

74<48

False

74

 

5

74

a(5)

74<18

False

74

74



Asyraf Naim bin Jamal Shahid said:
assignment18/08/2011
Attachments:

ASSIGNMENT

Name : Asyraf Naim bin Jamal Shahid    

ID        : 7029

 

a(1)

37

a(2)

74

a(3)

54

a(4)

48

a(5)

18

 

 

 

 

 

 

 

Command (draft)

p = 1

 BIG = a(p)

30 p = p+1

If BIG <  a(p)   then big  =  a(p)

If p = 5 then 40

go to 30

40 Print BIG

 

 

Tracing

p

BIG

a(p)

IF BIG < a(p)

BIG = a(p)

output

1

37

37

37<37

FALSE

 

2

37

74

37<74

74

 

3

74

54

74<54

FALSE

 

4

74

48

74<48

FALSE

 

5

74

18

74<18

FALSE

74



ASSIGNMENT

assignment yasterday
Attachments:

LOOPSSSSSSSSSSSSSSSS

Dim a(5) As Integer

For i = 1 To 5

b = InputBox("Enter No")

a(i) = Val(b)

Next i

big = a(1)

For i = 2 To 5

If big < a(i) Then big = a(i)

Next i

Form1.Print big

assignment
Attachments:

try this one,its shorter XD

it took me a week to think aiyoooo

 

Dim i As Integer

Dim a As Integer

a = InputBox("Enter No")

1 i = i + 1

If a = i Then MsgBox ("Odd Number"): GoTo 2

i = i + 1

If a = i Then MsgBox ("Even Number"): GoTo 2

GoTo 1

2 End


muhammad amir asyraf said:

solution for 1st question..alhamdulilah

 

Dim x As Integer

x = InputBox("numberlol")

a = 1

If x = a Then MsgBox ("input is odd number"): End

1 a = a + 2

If x = a Then MsgBox ("input is odd number"): End

If Not x = a Then GoTo 70

70 b = b + 2

If x = b Then MsgBox ("input is even number"): End

GoTo 1

for this program, when i tried a much bigger number, it gets an error message

so to solve this, u dont have to declare s as integer

because when (a+b+c)/2 turns out to have decimal points then it cant read the program XD

Dain Razali said:

Alright guys...question 2 solved ( Accept values of sides of a triangle and calculate the area )

 

Dim x, y, z, s As Integer

p = InputBox("Enter 1st side")
q = InputBox("Enter 2nd side")
r = InputBox("Enter 3rd side")
x = Val(p)
y = Val(q)
z = Val(r)
s = (x + y + z) / 2

a = (s * (s - x) * (s - y) * (s - z)) ^ (1 / 2)

Form1.Print a: MsgBox "Area Of Triangle Solved": End

 

Hope it helps~ :)

Afifah...it works for numbers up to 1000's...and even when u don't declare s as integer...entering values that are too large will still result in an error message...anyway i dont think anyone would want to solve with numbers so big...thts why we got units such as kilos, Giga, and Tera...to simplify things.

Afifah Ahmad said:

for this program, when i tried a much bigger number, it gets an error message

so to solve this, u dont have to declare s as integer

because when (a+b+c)/2 turns out to have decimal points then it cant read the program XD

Reply to Discussion

RSS

© 2025   Created by Ravichandran.   Powered by

Report an Issue  |  Terms of Service