Fifibonacci series

1) Go to your local community college and take CS 101 "Introduction to Computer Science".

2) Take a Progress 4GL programming class from PSC or from any of the excellent trainers and consultants who have been answering your questions.
 
If you can't write a program that adds up the 2 previous number in a sequence to get the next number you really need to reconsider if you want to work in computer programming ... Or you shouldn't be asking on a forum how to do your homework :P

Since i love helping even tho giving you this will probably not help you in the long term , it was fun to write... So here is my Fobonacci Temp-table creator ...

Code:
DEF TEMP-TABLE ttFibonacci 
    FIELD seqF AS INT
    FIELD valueF AS INT64
    INDEX seqF seqF.

DEF BUFFER b_ttFibonacci FOR ttFibonacci.

FUNCTION getValue RETURNS INT64
    (piSeq AS INT):

FIND b_ttFibonacci WHERE b_ttFibonacci.seqF = piSeq NO-LOCK NO-ERROR.

RETURN b_ttFibonacci.valueF.
END FUNCTION.

DEF VAR iMax AS INT.
DEF VAR i AS INT.

UPDATE "Max Number (MAX 92): " iMax.

IF iMax > 92 THEN iMax = 92.  /* Maximum for Integer 64 */

/* CREATE SEED VALUES */
CREATE ttFibonacci.
ASSIGN ttFibonacci.seqF = 0 ttFibonacci.valueF = 0.    
CREATE ttFibonacci.
ASSIGN ttFibonacci.seqF = 1 ttFibonacci.valueF = 1.    

DO i = 2 TO iMax:
    CREATE ttFibonacci.
    ttFibonacci.seqF = i .
    ttFibonacci.valueF = getValue(i - 1) + getValue (i - 2).    

END.

FOR EACH ttFibonacci NO-LOCK:
    DISP ttFibonacci.seqF ttFibonacci.valueF FORMAT '>>>,>>>,>>>,>>>,>>>,>>>,>>>,>>>,>>9'.
END.
 
????

Why would you B using the Advanced Business Logic (ABL) of Progress to write such a noddy, simple nothing to do with business program?
You have been provided with a solution, though this is something more suitable to BASIC programming.
 
Back
Top