How can I input numeric variables?
Uh...
As much as I understand from programming it would be symply adding the line
x=y
that results in variable x being y
Example
A=375 Print A
displays the numeric value of A. Nothing more is needed.
Try this program
Addition:
print "Addition" input "First number : ", z1$ z1 = int(z1$) input "Second number : ", z2$ z2 = int(z2$) z3 = z1 + z2 print"Your result:" print z1;: print " + ";: print z2;: print " = ";: input "", z4$ z4 = int(z4$) if z3 = z4 then print "RIGHT" if z3 <> z4 then print "WRONG"
input "New one ? (y) ", q1$ if q1$ = y then goto Addition end
But integer numbers only !
Thank you very much for your help
MS
if q1$ = "y" then goto Addition
The current version alows for input directly into a float variable
INPUT a -or- INPUT "Prompt",a
Hopefully this will remove the need to do
INPUT foo$ a = float(foo$)
like previously required.
Jim
Log in to post a comment.
How can I input numeric variables?
Uh...
As much as I understand from programming it would be symply adding the line
x=y
that results in variable x being y
Example
A=375
Print A
displays the numeric value of A. Nothing more is needed.
Try this program
Addition:
print "Addition"
input "First number : ", z1$
z1 = int(z1$)
input "Second number : ", z2$
z2 = int(z2$)
z3 = z1 + z2
print"Your result:"
print z1;: print " + ";: print z2;: print " = ";: input "", z4$
z4 = int(z4$)
if z3 = z4 then print "RIGHT"
if z3 <> z4 then print "WRONG"
input "New one ? (y) ", q1$
if q1$ = y then goto Addition
end
But integer numbers only !
Thank you very much for your help
MS
if q1$ = "y" then goto Addition
The current version alows for input directly into a float variable
INPUT a -or- INPUT "Prompt",a
Hopefully this will remove the need to do
INPUT foo$
a = float(foo$)
like previously required.
Jim