Skip to content

Project exam · Python Programming

Project exam: electricity bills for a housing society

Project examintermediate· about 1.25 hours· 6 steps· 75 min · pass 60%

The brief

In 75 minutes, build the billing script a housing society office uses each month: check meter readings, charge units by slab, add the fixed charge and duty, read the readings sheet while reporting bad rows, and work out due dates and late fees.

Why it matters

Electricity boards, housing societies and facility-management firms bill by slabs every month, from meter readings typed in by hand. A script that charges each slab correctly, refuses impossible readings and applies due dates and late fees fairly saves hours of work and many complaints.

Skills you practise

  • functions
  • raising and catching ValueError
  • loops over a slab table
  • csv with io.StringIO
  • datetime and timedelta

What you will have at the end

bill.py: a society electricity-billing script that turns a readings sheet into bills, lists the bad rows and applies due dates and late fees.

How it is marked (rubric, 100 points)
Correct billsEvery step passes: slabs charged band by band, duty on energy only, bad rows reported, dates and fees right.50
Handles bad dataImpossible readings raise ValueError, and the sheet reader keeps going and lists every bad flat.20
Clean functionsEach function does one job and reuses the others; the tariff numbers stay in the constants at the top.20
Finished in timeAll six steps handed in within 75 minutes.10
  • 6tasks
  • 75 mintime limit
  • 60%to pass

Rules: a project exam

  • The exam opens full screen. Stay on this page until you hand it in.
  • Opening another tab or app, or leaving full screen, counts as one time away. After 3 times the exam ends.
  • No copy or paste during the exam.
  • No hints and no answers. You can run your code, but the checks run only when you hand in.
  • Every task is checked automatically when you hand in, or when the time is up.
  • You see which tasks passed at the end. You can take it again.
Not yet, go back