Page 1 of 1

need serious beginner help

Posted: Tue Mar 21, 2006 4:20 am
by Jimbo
Just got this wacky program because I always thought it was fun to make things on my graphing calculator. I was just trying to make this program about the standard formula for a line and I can't get the thing to work! It's been driving me nutty and any help would be greatly appreciated! :wink:

If OpenConsole()
PrintN(""):PrintN("Input A: ")
a.s=Input()
StrF(a)
PrintN(""):PrintN("Input B: ")
b.s=Input()
StrF(b)
PrintN(""):PrintN("Input C: ")
c.s=Input()
StrF(c)
xintercept.f=(c/a)
yintercept.f=(c/b)
ClearConsole()
PrintN("The X-intercept is "+Str(xintercept)+"and the Y-intercept is "+Str(yintercept)+".")
EndIf
End

Posted: Tue Mar 21, 2006 9:41 am
by STU-ASI
ok two things...

You are getting as string as input then trying to perform maths functions on it.
Not going to work...

Then you are trying to convert the input string to another string.

here is your ammended program.

just use the Val() around the input

Code: Select all

If OpenConsole() 
PrintN(""):PrintN("Input A: ") 
a.f=Val(Input())
 
PrintN(""):PrintN("Input B: ") 
b.f=Val(Input())

PrintN(""):PrintN("Input C: ") 
c.f=Val(Input())
 
xintercept.f=(c/a) 
yintercept.f=(c/b) 
ClearConsole() 
PrintN("The X-intercept is "+Str(xintercept)+"and the Y-intercept is "+Str(yintercept)+".")
x.s=Input() 
EndIf 
End

Posted: Tue Mar 21, 2006 10:43 am
by Kale
Just a polite reminder Jimbo, please only post in one forum section, we all read them all so we will see your post. Cross-posting makes things very messy. Ta. 8)