#!/usr/bin/env -S uv run python """Reperform Linden Peak's acquisition and construction schedules. Run directly with uv. This lab uses only the Python standard library: uv run python linden-peak-acquisition-and-construction.py """ from __future__ import annotations def money(amount: float) -> str: """Format dollars with commas and accounting-style negatives.""" if abs(amount) < 0.005: return "—" if amount < 0: return f"(${abs(amount):,.2f})" return f"${amount:,.2f}" def percent(rate: float) -> str: """Format a decimal rate as a percentage.""" return f"{rate:.2%}" def main() -> None: purchase_price = 420_000.0 qualifying_costs = { "Freight": 12_000.0, "Installation": 18_000.0, } period_costs = { "Operator training": 7_000.0, "Abnormal shipping damage": 3_000.0, } initial_asset_cost = purchase_price + sum(qualifying_costs.values()) print("LINDEN PEAK — ASSET ACQUISITION AND CONSTRUCTION") print("Scope: arithmetic under supplied cost, value, date, and borrowing roles") print() print("1 · INITIAL MACHINE COST") print(f" {'Purchase price':30} {money(purchase_price):>16}") for label, amount in qualifying_costs.items(): print(f" {label:30} {money(amount):>16}") print(f" {'Initial asset cost':30} {money(initial_asset_cost):>16}") print(f" {'Period costs kept visible':30} {money(sum(period_costs.values())):>16}") bundle_price = 900_000.0 supported_values = { "Land": 300_000.0, "Building": 600_000.0, "Equipment": 100_000.0, } total_supported_value = sum(supported_values.values()) allocations = { label: bundle_price * value / total_supported_value for label, value in supported_values.items() } print() print("2 · BUNDLED-PRICE ALLOCATION") print(f" {'Asset':18} {'Value':>16} {'Share':>12} {'Assigned cost':>18}") for label, value in supported_values.items(): share = value / total_supported_value print( f" {label:18} {money(value):>16} {percent(share):>12} " f"{money(allocations[label]):>18}" ) print( f" {'Allocation check':18} {'':>16} {'':>12} " f"{money(sum(allocations.values()) - bundle_price):>18}" ) construction_direct_costs = {"Materials": 500_000.0, "Direct labor": 180_000.0} expenditures = [ ("January 1 draw", 300_000.0, 1.0), ("July 1 draw", 240_000.0, 0.5), ] weighted_expenditures = [ (label, amount, fraction, amount * fraction) for label, amount, fraction in expenditures ] weighted_average = sum(weighted for _, _, _, weighted in weighted_expenditures) specific_limit = 350_000.0 specific_rate = 0.06 excess_rate = 0.08 actual_interest = 24_000.0 specific_base = min(weighted_average, specific_limit) excess_base = max(weighted_average - specific_limit, 0.0) avoidable_interest = specific_base * specific_rate + excess_base * excess_rate capitalized_interest = min(avoidable_interest, actual_interest) expensed_interest = actual_interest - capitalized_interest constructed_asset_cost = sum(construction_direct_costs.values()) + capitalized_interest print() print("3 · CAPITALIZED INTEREST") print(f" {'Expenditure':18} {'Amount':>16} {'Weight':>12} {'Weighted':>18}") for label, amount, fraction, weighted in weighted_expenditures: print( f" {label:18} {money(amount):>16} {fraction:>12.2f} {money(weighted):>18}" ) print(f" {'Weighted average':18} {'':>16} {'':>12} {money(weighted_average):>18}") print() print(f" {'Specific borrowing base':30} {money(specific_base):>16}") print(f" {'Excess borrowing base':30} {money(excess_base):>16}") print(f" {'Avoidable interest':30} {money(avoidable_interest):>16}") print(f" {'Actual-interest ceiling':30} {money(actual_interest):>16}") print(f" {'Capitalized interest':30} {money(capitalized_interest):>16}") print(f" {'Interest expense':30} {money(expensed_interest):>16}") print(f" {'Constructed asset cost':30} {money(constructed_asset_cost):>16}") print() print("A zero check verifies arithmetic only. It does not establish asset control,") print("cost eligibility, supported values, qualifying-asset status, or readiness.") if __name__ == "__main__": main()