# Quad.bas draw -1 qbtn$="Quit" form btn 0,160,0,0, qbtn$, 1 form btn 117,147,40,12, "Enter",1 form fld 20,30,40,12, "",1 form fld 20,45,40,12, "",1 form fld 20,60,40,12, "",1 draw "Quadratic formula solver",20,15,1 draw "a =",5,31 draw "b =",5,46 draw "c =",5,61 top: x=asc(input$(1)) if x=3 then k=fn launch("lnch", -1) if x=14 then a=val(s$(0)) b=val(s$(1)) c=val(s$(2)) if (b^2)-(4*a*c)>0 then d$="two" if (b^2)-(4*a*c)=0 then d$="one" if (b^2)-(4*a*c)<0 then d$="none" endif h$=((-1*b)+sqr((b^2)-(4*(a)*(c))))/(2*a) i$=((-1*b)-sqr((b^2)-(4*(a)*(c))))/(2*a) j=(-1*b)/(2*a) : k$=j l=(a*(j^2))+(b*j)+c : t$=l draw 0,85,160,55,-7 draw "real number solutions: "+d$,5,80 draw "x-intrcpt: ("+h$+", 0)",5,92 draw "x-intrcpt: ("+i$+", 0)",5,104 draw "vertex: ("+k$+", "+t$+")",5,116 goto top end