Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
challenge finite difference
#1
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
Reply


Messages In This Thread
challenge finite difference - by cooliebai - 11-01-2005, 07:16 AM
challenge finite difference - by Agamemnus - 11-02-2005, 06:29 AM
challenge finite difference - by cooliebai - 11-03-2005, 06:34 AM
challenge finite difference - by Agamemnus - 11-03-2005, 08:21 PM
challenge finite difference - by cooliebai - 11-04-2005, 08:12 AM
challenge finite difference - by Agamemnus - 11-05-2005, 04:19 AM
challenge finite difference - by Agamemnus - 11-07-2005, 07:40 AM
challenge finite difference - by cooliebai - 11-08-2005, 09:05 AM
challenge finite difference - by Agamemnus - 11-08-2005, 11:30 AM
challenge finite difference - by Quibbler - 11-08-2005, 05:22 PM
challenge finite difference - by Agamemnus - 11-08-2005, 08:53 PM
challenge finite difference - by Quibbler - 11-08-2005, 08:59 PM
challenge finite difference - by Agamemnus - 11-09-2005, 02:51 AM
challenge finite difference - by Quibbler - 11-10-2005, 05:41 PM
challenge finite difference - by Agamemnus - 11-10-2005, 11:45 PM
challenge finite difference - by Quibbler - 11-11-2005, 12:21 AM
challenge finite difference - by Agamemnus - 11-12-2005, 06:06 AM
challenge finite difference - by Agamemnus - 11-13-2005, 08:44 PM
challenge finite difference - by Quibbler - 11-14-2005, 04:44 PM
challenge finite difference - by Agamemnus - 11-14-2005, 11:17 PM
challenge finite difference - by Quibbler - 11-16-2005, 05:26 PM
challenge finite difference - by Agamemnus - 11-16-2005, 09:16 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)