11-01-2005, 07:16 AM

hey all a finite difference program would be great for anyone who is in highschool or even university who is doing finite differences and wants teh answer as quick as possible.

also a long search on google for finite difference program using Qbasic was a failure. i believe that if anyone on this forum makes a finite difference program will be the first people to ever make one and post it on the net.

so thats my challenge, make a finite difference program.

It has to calculate finite differences and put it into its equation

(ex. ax^3 + bx^2 + cx + d)

and then it needs to solve for each variable

(i.e: a, b, c, d)

at the beginning of the program it needs to ask the user something like this, "input the x-values" then say "input the y-values" then it needs to do its magic by itself without the user really having to do anything much after that.

i have already got it started but i just got an upgrade in my position at work and i have no time to comlete it. here is the begining of it:

CLS

CONST MaxValues = 8

DIM X(MaxValues) AS INTEGER

DIM Y(MaxValues) AS INTEGER

PRINT "Enter x-values. Just press Enter when finished"

DO

LINE INPUT "X = "; n$: IF n$ = "" THEN EXIT DO

Goof = 0

FOR i = 1 TO LEN(n$)

IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN

PRINT "Sorry, bad number": Goof = 1: EXIT FOR

END IF

NEXT i

IF Goof = 0 THEN HowMany = HowMany + 1: X(HowMany) = VAL(n$)

LOOP

PRINT : PRINT "OK, now enter the Y-values"

FOR GetY = 1 TO HowMany

PRINT "X = "; X(GetY); " Y = ";

DO

Goof = 0

DO

LINE INPUT n$

IF n$ = "" THEN PRINT "You must enter a value"

LOOP WHILE n$ = ""

FOR i = 1 TO LEN(n$)

IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN

PRINT "Sorry, bad number": Goof = 1: EXIT FOR

END IF

NEXT i

LOOP WHILE Goof = 1

Y(GetY) = VAL(n$)

NEXT GetY

FOR i = 1 TO HowMany

PRINT "X ="; X(i), "Y ="; Y(i)

NEXT i

SYSTEM

also a long search on google for finite difference program using Qbasic was a failure. i believe that if anyone on this forum makes a finite difference program will be the first people to ever make one and post it on the net.

so thats my challenge, make a finite difference program.

It has to calculate finite differences and put it into its equation

(ex. ax^3 + bx^2 + cx + d)

and then it needs to solve for each variable

(i.e: a, b, c, d)

at the beginning of the program it needs to ask the user something like this, "input the x-values" then say "input the y-values" then it needs to do its magic by itself without the user really having to do anything much after that.

i have already got it started but i just got an upgrade in my position at work and i have no time to comlete it. here is the begining of it:

CLS

CONST MaxValues = 8

DIM X(MaxValues) AS INTEGER

DIM Y(MaxValues) AS INTEGER

PRINT "Enter x-values. Just press Enter when finished"

DO

LINE INPUT "X = "; n$: IF n$ = "" THEN EXIT DO

Goof = 0

FOR i = 1 TO LEN(n$)

IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN

PRINT "Sorry, bad number": Goof = 1: EXIT FOR

END IF

NEXT i

IF Goof = 0 THEN HowMany = HowMany + 1: X(HowMany) = VAL(n$)

LOOP

PRINT : PRINT "OK, now enter the Y-values"

FOR GetY = 1 TO HowMany

PRINT "X = "; X(GetY); " Y = ";

DO

Goof = 0

DO

LINE INPUT n$

IF n$ = "" THEN PRINT "You must enter a value"

LOOP WHILE n$ = ""

FOR i = 1 TO LEN(n$)

IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN

PRINT "Sorry, bad number": Goof = 1: EXIT FOR

END IF

NEXT i

LOOP WHILE Goof = 1

Y(GetY) = VAL(n$)

NEXT GetY

FOR i = 1 TO HowMany

PRINT "X ="; X(i), "Y ="; Y(i)

NEXT i

SYSTEM