Chuyển đến nội dung

Bài 36 · Projects and Practice

Project: A Full Accounting Cycle

Run a complete accounting cycle for a small business: journal entries, ledger balances, trial balance, adjustments, income statement and balance sheet, all in code.

In this project you take a small business through the whole accounting cycle: record transactions, post them to accounts, prepare a trial balance, make adjusting entries, and produce the financial statements. You will build a tiny bookkeeping engine in Python. It is a teaching stand-in, not accounting software, but it uses the same logic as the real thing.

The business

Hilltop Bikes starts the year with a $30,000 investment from its owner and has these transactions (all invented):

  1. Owner invests $30,000 cash.
  2. Buys equipment for $12,000 cash.
  3. Buys inventory on credit for $20,000.
  4. Sells goods on credit for $35,000; those goods cost $18,000 (perpetual inventory).
  5. Customers pay $28,000.
  6. Pays the supplier $15,000.
  7. Pays wages of $6,000.
  8. Pays $3,000 for 12 months of rent, starting 1 October (year end is 31 December).

Adjustments at year end

  • Rent: 3 of 12 months used, so $750 is an expense and $2,250 is prepaid.
  • Depreciation: equipment $12,000, residual $2,000, 5 years, straight-line: $2,000.
  • Accrued wages: $500 owed.

Step 1: journal and trial balance

Each transaction is a tuple of the account to debit, the account to credit, and the amount.

Python Journal, ledger and trial balance

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 2: adjust and prepare the statements

Python Adjustments and statements

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check the results by hand

  • Cash: 30,000 − 12,000 + 28,000 − 15,000 − 6,000 − 3,000 = 22,000.
  • Profit: 35,000 − 18,000 − 6,500 (wages incl. accrual) − 750 − 2,000 = 7,750.
  • Total assets: 43,250, liabilities 5,500, equity 30,000 + 7,750 = 37,750.

If your run gives different numbers, trace the entries one by one.

Your extensions

  1. Add a dividend of $1,000 (debit Dividends, credit Cash) and show how closing equity changes.
  2. Add an allowance for doubtful accounts of 5% of receivables (bad debts).
  3. Compute the ratios in profitability and liquidity.
  4. Build a cash flow statement (cash flow lesson) and test that closing cash is 22,000 less the dividend.

When a balance does not match, print the ledger after each entry. Most errors come from a wrong account name or a reversed debit and credit.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. What is the correct order of the accounting cycle?

    Record, post, check, adjust, then report.
  2. 2. In the project, why is rent expense only $750?

    3,000 × 3/12 = 750; the rest is a prepaid asset.
  3. 3. Which adjustment creates a liability?

    Accrued wages are owed, so Wages payable is a liability.

Summary

  • The cycle: journal, ledger, trial balance, adjustments, statements.
  • Each transaction debits one account and credits another by the same amount.
  • Adjustments bring in accruals, deferrals and depreciation.
  • The balance sheet balances only when profit is included in equity.

Next: Project: Ratio Analysis Report

Theo dõi tiến độ của bạn

Tạo tài khoản miễn phí để đánh dấu bài đã học và tiếp tục từ chỗ bạn dừng lại trên mọi thiết bị.