Project exam · C++ Programming (modern C++ and DSA)
Project exam: hostel mess bills
The brief
A timed, hands-on exam. A college hostel mess needs its monthly bills. You get one file, mess.cpp, whose main is already written, and six functions or classes to complete in 90 minutes: meal rates and bills, a minimum charge, meal counts, parsing typed records, a mess account that rejects bad deposits, and the top eaters. Each task is checked from the program's output.
Why it matters
Coding rounds at service and product companies in India increasingly give a small, realistic program to finish against the clock instead of only multiple-choice questions. This exam practises exactly that: read existing code, fill in functions to a spec, keep the build clean, and get exact output.
Skills you practise
- functions and switch
- std::map and structured bindings
- std::optional and std::istringstream
- a class with an invariant and an exception
- std::sort with a lambda
- a clean -Wall -Wextra build
You need
- g++ 11 or newer (MinGW-w64 via MSYS2 on Windows, build-essential on Ubuntu, Xcode command line tools on macOS, where g++ runs Apple clang)
- 90 minutes without interruptions; build and run as often as you like
What you will have at the end
mess.cpp with all six tasks done, building cleanly with -Wall -Wextra and printing the exact mess report.
How it is marked (rubric, 100 points)
| Correct outputEvery task's lines match exactly. | 60 |
|---|---|
| Clean buildNo warnings or errors with -Wall -Wextra. | 15 |
| Sound C++const references for inputs, std::optional instead of magic values, the exception only for a bad deposit, a lambda for sorting. | 25 |
- 6tasks
- 90 mintime limit
- 70%to pass
Rules: a project exam
- Do each task on your own machine, then paste the command output into its box here.
- Work alone, without notes or a search engine, as in the real 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.