Skip to content

Lab · C# and .NET

Lab: a tiffin service's monthly bill

Labbeginner· about 1.5 hours· 5 steps

The brief

Annapurna Tiffin Service in Nagpur delivers lunch and dinner tiffins and bills each customer once a month. You install the .NET SDK, create a console app, and make it work out the month's bill with 5% GST, first from fixed numbers and then from what the owner types.

Why it matters

Small businesses in India run on bills like this one, and most first jobs in .NET start with console tools and small calculations exactly like it. You also practise the everyday developer loop: create a project with the dotnet CLI, edit, run, read the output and fix.

Skills you practise

  • dotnet --version, new and run
  • top-level statements
  • int, decimal and const
  • string interpolation with :F2
  • integer division
  • int.TryParse

You need

  • .NET 8 SDK or newer (the current LTS, .NET 10, is recommended) from dotnet.microsoft.com
  • A terminal (PowerShell, Command Prompt, or Terminal on macOS/Linux) and a code editor such as VS Code

What you will have at the end

The TiffinBill console project: it asks for the month's lunch and dinner counts, prints a GST bill to the paisa, and refuses bad input without crashing.

How it is marked (rubric, 100 points)
Correct billEvery check passes: 3759.00 for 22 and 18, 3580.50 for 20 and 18, GST rounded to paise.40
Safe inputWords and negative numbers give a clear message and no bill; nothing crashes.25
Right typesdecimal with the m suffix for money, const for prices and the rate, int for counts.20
Readable codeClear camelCase names and a short comment for each block.15

0/5 steps done

Step 1 of 5

Check the .NET SDK

dotnet --version prints an SDK version of 8 or newer.

Install the .NET SDK (not only the runtime) from dotnet.microsoft.com, then open a NEW terminal so it can find the dotnet command. dotnet --version prints the version of the SDK in use, such as 8.0.403 or 10.0.100. Any version from 8 upwards works for this course.

Run this on your machine, then paste the output below
$ dotnet --version
Your notes: Program.cs

Write down each command you ran. It goes into your project summary.