Click to See Complete Forum and Search --> : Help Me out. !
Active
Mar 10th, 2001, 09:49 PM
I was just trying to teach my Younger Brother (5th Grader) BASIC Programming.
Well it was going on well untill I wrote this to
Explain how we asign values to variables.
Initially
a = 1
b = 2
now if
a = a +b
then a = 3
Now my brother is arguing how
a = a + b can be possible if b is not equal to zero.
I tried to explain to him that it is just a way of writing in Programming languages.
He called me an Ediot (I deserve that :( ).
Is there any way I could explain to him and justify such a syntax ?
ha.. thats is a really tough job Active...
Tell him that you are assigning the value a + b to a rather than stating a is equal to a + b
Active
Mar 10th, 2001, 10:00 PM
I can't talk to him about memory...He will simply shout at me.
He agrees that I am assigning the value of a+b to a
But says that I cannot write a = a + b and assume it is
correct.
He says his math teacher will fail him if he wrote like that.
If he agrees that you are assigning the value of a + b to a, then why can he not understand that you have to write a = a + b?
Active
Mar 10th, 2001, 10:06 PM
His confusion stems from the fact that we use a
in both sides of the equal sign.
Active
Mar 10th, 2001, 10:08 PM
What he actually does in mind is replacing the
characters by their values..
So he thinks like
1 = 1 + 2
Tell him to think like this:
[EMPTY BOX LABELED a] = [VALUE OF a] + [VALUE OF b]
Of course, it isn't really empty...
dimava
Mar 10th, 2001, 10:11 PM
teach him VB, which is easier
Active
Mar 10th, 2001, 10:11 PM
I will try that....thanks...
HarryW
Mar 10th, 2001, 10:32 PM
Sounds like the problem is just notation. You could use a symbol like this <- to explain it, and then just swap it when it comes to running the program. Perhaps you could show him Pascal, that uses := instead of = for assignment. = is for equality in Pascal, as he is thinking of it. BASIC (and VB too) just uses the context to decide which operator it is, assignment or equality.
Active
Mar 10th, 2001, 10:49 PM
Thanks harry! That should do it.
Now I am using <-- operator for assigning.
I presume he Understood the difference.
dimava
Mar 10th, 2001, 10:49 PM
I think that the easiest (and fairly prowerful) language is VB, because to get the same results in BASIC you need to do a hell of a lot code. because you need to program the mouse.. and draw all the lines and stuff.. but in VB you just click-and-drag, change the properties.. and stuff
I stated VB when I was in 7th grade but i would not have been able to understand it in 5th.
Another good thing in VB is that you can create a program without 1 line of code
random150
Mar 11th, 2001, 12:15 AM
The = is confusing
just tell him if he still doesnt understand to think of the = as
glass that your putting the stuff on the right into the left.
x = A + B
x is a glass
A + B is the water
this is much more simple to understand it.
dimava
Mar 11th, 2001, 12:19 AM
and if he still doesn't understand it, then tell him to wait a few years untill trying to learn it
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.