Depreciation Schedule

Developer(s): Imre Auersbacher
Date: 1985
Type: Program
Platform(s): TS 2068

Appears on

Source Code

    2 REM  Depreciation Schedule 
    4 REM  \* 1985 I. Auersbacher 
   10 DEF FN a(x)=INT (k*x+0.5)/k
   14 DEF FN a$(x,c$)=c$+(".00" AND x=INT x)+("0" AND ("0"+c$)(LEN c$)=".")
   16 BORDER 5: PAPER 3: LET k=100: CLS : BEEP 0.07,22: GO TO 50
   20 LET y=FN a(y): LET c$=FN a$(y,STR$ y): RETURN 
   25 LET d=(c-s)/l: RETURN 
   30 LET d=2*(c-s)*(l+1-z)/(l*(l+1)): RETURN 
   35 IF z<t THEN LET d=2*(c-s)/l*(1-2/l)^(z-1): RETURN 
   38 LET d=((c-s)*(1-2/l)^(t-1))/(l-t+1): RETURN 
   50 PRINT PAPER 6;AT 2,2;" Depreciation Calculations "; PAPER 7;AT 6,11;" Options ";AT 8,7;"1. Straight-Line   ";AT 9,7;"2. Sum-of-Years    ";AT 10,7;"3. Double-Declining";AT 11,7;"4. Compare methods "
   52 INPUT ; PAPER 7; FLASH 1;"Enter option (1-4): ";x
   54 LET x=INT x: IF (x<1)+(x>4) THEN BEEP 1,-20: GO TO 52
   56 PAPER 7: PRINT PAPER 6;AT 7+x,4;">>": PAUSE 100: CLS 
   60 IF x=1 THEN PRINT PAPER 6;" 1. Straight-Line Depreciation "
   62 IF x=2 THEN PRINT PAPER 6;" 2. Sum-of-Years Digits Method "
   64 IF x=3 THEN PRINT PAPER 6;" 3. Double-Declining-Balance   "
   66 IF x=4 THEN PRINT PAPER 6;" 4. Comparison of all methods  "
   70 PRINT : PRINT "Original Cost: ";: INPUT c: PRINT c
   72 PRINT "Salvage Value: ";: INPUT s: PRINT s: IF (s>=c)+(s<0) THEN BEEP 1,-20: CLS : GO TO 60
   74 PRINT "Lifetime (yr): ";: INPUT l: LET l=ABS l: PRINT l
   76 IF x=4 THEN GO TO 120
   80 PRINT : PRINT "Year  Depreciation   Book Value ": PRINT "\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
   90 LET t=INT ((l+1)/2)+1: LET b=c: FOR z=1 TO l: GO SUB 20+5*x
   95 LET b=b-d: LET y=d: GO SUB 20: LET d$=c$: LET y=b: GO SUB 20: LET b$=c$: PRINT TAB 2;z;
  100 PRINT TAB 15-LEN d$;d$;TAB 29-LEN b$;b$: NEXT z: STOP :
  120 PRINT : PRINT "Yr";TAB 4;"Straight";TAB 14;"Sum-of";TAB 23;"Double-": PRINT "#";TAB 5;"-Line";TAB 14;"-Years";TAB 23;"Declining": PRINT "\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
  130 LET t=INT ((l+1)/2)+1
  140 FOR z=1 TO l: GO SUB 25: LET y=d: GO SUB 20: LET s$=c$: GO SUB 30: LET y=d: GO SUB 20: LET b$=c$: GO SUB 35: LET y=d: GO SUB 20: LET d$=c$: PRINT z;
  150 PRINT TAB 11-LEN s$;s$;TAB 21-LEN b$;b$;TAB 31-LEN d$;d$
  160 NEXT z: STOP : STOP 
  200 SAVE "deprec" LINE 10
Scroll to Top