BEGIN
// Step 1: Input the asset value and the number of years for depreciation
PRINT "Enter the value of the asset:"
INPUT asset_value
PRINT "Enter the number of years for depreciation:"
INPUT years_of_depreciation
// Step 2: Calculate the sum of the year's digits
sum_of_years_digits = 0
FOR year FROM 1 TO years_of_depreciation DO
sum_of_years_digits = sum_of_years_digits + year
END FOR
// Step 3: Initialize variables for depreciation calculations
balance = asset_value
// Step 4: Output headings
PRINT "Year | Depreciation Amount | Balance Outstanding"
PRINT "---------------------------------------------"
// Step 5: Calculate and output depreciation for each year
FOR year FROM 1 TO years_of_depreciation DO
// Calculate the depreciation for the current year
depreciation_amount = ((years_of_depreciation - (year - 1)) / sum_of_years_digits) * asset_value
// Update the balance outstanding
balance = balance - depreciation_amount
// Step 6: Output the year, depreciation amount, and balance
PRINT year, "|", depreciation_amount, "|", balance
END FOR
END