please what do you think of my code below and how can i make it better

please what do you think of my code below and how can i make it better it is in q basic and also can you tell me if anything is wrong anywhere i am new to programming

DIM sel AS STRING
DO
CLS
PRINT "formula: y = a * x ^ 2 + b * x + c"
PRINT "enter values for a, b and c "

6 INPUT "Please enter a:", a!
IF a=0 THEN
PRINT "PLEASE INPUT ANOTHER VALUE FOR a"
GOTO 6
END IF
INPUT "Please enter b:", b!
INPUT "Please enter c:", c!

LET R= b! ^ 2 - 4 * a! * c!
PRINT "Discriminant ="; R
LET X1 = (-b! - SQR(R)) / (2 * a!)
LET X2 = (-b! + SQR(R)) / (2 * a!)
PRINT " x1 ="; X1
PRINT " x2 ="; X2
DO
INPUT "MAKE ANOTHER CALCULATION (Y/N):", sel
sel = UCASE$(sel)
LOOP UNTIL sel ="Y" OR sel = "N"
LOOP UNTIL sel= "N"
END



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories