kimpro82 / MyLegacyPractice

Old School Party!
1 stars 0 forks source link

Fortran : Depreciation Calculator 2 #17

Closed kimpro82 closed 7 months ago

kimpro82 commented 7 months ago

Run

gfortran -o main DepreciationCalculator2.f95
./main

Output

Enter the initial cost of the asset           : 11000
Enter the salvage value of the asset          : 1000
Enter the useful life of the asset (in years) : 5
Enter the depreciation rate (%)
  (Default: 2 / useful life, ≒ DDB)          : 50

<Straight-Line Method>

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         2000.00         2000.00         9000.00
     2         2000.00         4000.00         7000.00
     3         2000.00         6000.00         5000.00
     4         2000.00         8000.00         3000.00
     5         2000.00        10000.00         1000.00

<Declining Balance Method> (Rate: 50.00%)

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         5500.00         5500.00         5500.00
     2         2750.00         8250.00         2750.00
     3         1375.00         9625.00         1375.00
     4          375.00        10000.00         1000.00

<Double Declining Balance Method> (Rate: 40.00%)

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         4400.00         4400.00         6600.00
     2         2640.00         7040.00         3960.00
     3         1584.00         8624.00         2376.00
     4          950.40         9574.40         1425.60
     5          425.60        10000.00         1000.00

<Sum-of-the-Years' Digits Method>

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         3333.33         3333.33         7666.67
     2         2666.67         6000.00         5000.00
     3         2000.00         8000.00         3000.00
     4         1333.33         9333.33         1666.67
     5          666.67        10000.00         1000.00
kimpro82 commented 7 months ago

Output (Adjusted)

Depreciation Calculator Ver.2 (2024.04.22)

  Enter the initial cost of the asset           : 11000
  Enter the salvage value of the asset          : 1000
  Enter the useful life of the asset (in years) : 5
  Enter the depreciation rate(%)
    (Default: 2 / useful life, ≒ DDB)           : 50

※ In declining balance method and double declining balance depreciation, 
  the salvage value is not recognized in the calculation of the depreciation base.

<Straight-Line Method>

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         2000.00         2000.00         9000.00
     2         2000.00         4000.00         7000.00
     3         2000.00         6000.00         5000.00
     4         2000.00         8000.00         3000.00
     5         2000.00        10000.00         1000.00

<Declining Balance Method> (Rate: 50.00%)

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         5500.00         5500.00         5500.00
     2         2750.00         8250.00         2750.00
     3         1375.00         9625.00         1375.00
     4          375.00        10000.00         1000.00

<Double Declining Balance Method> (Rate: 40.00%)

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         4400.00         4400.00         6600.00
     2         2640.00         7040.00         3960.00
     3         1584.00         8624.00         2376.00
     4          950.40         9574.40         1425.60
     5          425.60        10000.00         1000.00

<Sum-of-the-Years' Digits Method>

  Year    Depreciation     Accumulated            Book
               Expense    Depreciation           Value
     1         3333.33         3333.33         7666.67
     2         2666.67         6000.00         5000.00
     3         2000.00         8000.00         3000.00
     4         1333.33         9333.33         1666.67
     5          666.67        10000.00         1000.00