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

Dain, integers are from -32768 to 32767, when i dont declare s as an integer, i can search for areas of triangle even when i insert up to 32767. you should try it, then you would understand what i mean. for the program that you posted here, i cant get the area of triangle even when i insert values up to 100s. that is why i dont declare s as integer. if anybody have the same problem as i do, then try not declaring. 

Dain Razali said:

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


Yeah...i guess it's better if we don't declare...sorry for the mistake.. :/ but i manage to insert 9000, 8000, and 6570 and it still gave me the area...lol XD but i guess not declaring s as integer would definitely be better...thx pipah! :D great work.



Afifah Ahmad said:

Dain, integers are from -32768 to 32767, when i dont declare s as an integer, i can search for areas of triangle even when i insert up to 32767. you should try it, then you would understand what i mean. for the program that you posted here, i cant get the area of triangle even when i insert values up to 100s. that is why i dont declare s as integer. if anybody have the same problem as i do, then try not declaring. 


no worries dain XD

guys,

 for the homework that dr ravi gave us, are we to share it here or wait for class?

Homework not to share in this place. Dr.Ravi

 

This is not an acceptable assignment work FAIZ.

Mohamed Faiz bin Mohamed Razali said:
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



Hello my dear Block 4 computing students,

                                                                 I can see that you are skipping some part of my lecturer which is so important to you all. As i have always mentioned in class that not one i utter in classroom is unimportant with respect to exam point of view. like the $ sign, which i did mention in the class as string variable. A$ = 5 is wrong , this is because you are trying to assign a numeric value 5 to a string varibale. So, A$ = "5" is right however look 5 is not a number but a string.

 

We will learn a lot about string manipulation in the next week.

Dr.Ravi

Both amir's program and afifah's program is wrong.  I did ask you to input any number and fine if it is odd or even and the number of program lines should be only two lines. You have written a long programe, which i dont want.

Dr.Ravi


Afifah Ahmad said:

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

AMIR did you think about the program on "odd" or "even" like what i suggested to you. Dr.Ravi

Hello, i have not seen any one since Satuday in the discussion forum. Can any one share the Flowchart of Amstrong number?

 

Dr.Ravi

 

This is today's homework. Finding how many even ASCII number are there in a given string.

a$ = InputBox("Enter a word")
For i = 1 To Len(a$)
b = Mid$(a$, i, 1)
c = Asc(b)
d = Val(c) / 2
e = d - Int(d)
If e = 0 Then v = v + 1
Next i
Form1.Print v

Hello Boss, Good work, I can see you have got some new logic. Great.

Dr.Ravi

 

Reply to Discussion

RSS

© 2025   Created by Ravichandran.   Powered by

Report an Issue  |  Terms of Service