Project · C# and .NET
Project: a kirana shop GST bill
The brief
Build the billing program for Shree Ganesh Kirana in Indore: items in arrays, GST by slab with a switch expression, a neatly aligned bill, round-off to the nearest rupee, and change for the cash the customer hands over.
Why it matters
Billing software is one of the first things small businesses buy, and every billing screen does these exact steps: line totals, GST per slab, round-off and change. Junior developers at billing and POS (point-of-sale) companies work on this logic, where one wrong rounding rule means hundreds of wrong bills a day.
Skills you practise
- dotnet new and dotnet build
- parallel arrays and for loops
- switch expressions
- Math.Round and MidpointRounding
- StringBuilder and alignment
- decimal.TryParse in a loop
You need
- .NET 8 SDK or newer
- A terminal and a code editor (VS Code with the C# Dev Kit, Visual Studio or Rider)
What you will have at the end
The KiranaBill console project: an aligned GST bill for five items, GST by slab, round-off to the rupee and change, with input checks. Add a screenshot of a run to your portfolio.
How it is marked (rubric, 100 points)
| Correct moneyEvery check passes: subtotal 1143.00, GST 73.50, payable 1217.00, change 783.00. | 40 |
|---|---|
| Robust inputWords and short amounts are refused politely and asked again; nothing crashes. | 20 |
| Code structureGstRate and BuildBill are separate methods that return values; no rate is typed twice. | 25 |
| PresentationThe columns line up and every rupee amount has two decimals. | 15 |
0/6 steps done
Step 1 of 6
Create the project and build it
A console project named KiranaBill exists, holds this project's Program.cs, and builds with no errors.
dotnet new console -n KiranaBill makes the project in a new KiranaBill folder (-n names the project and the folder). Replace its Program.cs with this project's starter. dotnet build only compiles: it is the quickest way to see errors (they look like Program.cs(12,5): error CS1002: ; expected) without running anything. Fix every error before you go on.
dotnet new console -n KiranaBill
cd KiranaBill
dotnet build$ dotnet new console -n KiranaBill
cd KiranaBill
(copy this project's Program.cs into the folder)
dotnet buildYour notes: Program.cs
Write down each command you ran. It goes into your project summary.