Program for a speed camera I am doing some online exercises, and I came across this: "Your job is to write a program for a speed camera. For simplicity, ignore the details such as camera, sensors, etc and focus purely on the logic. Write a program that asks the user to enter the speed limit. Once set, the program asks for the speed of a car. If the user enters a value less than the speed limit, program should display Ok on the console. If the value is above the speed limit, the program should calculate the number of demerit points. For every 5km/hr above the speed limit, 1 demerit points should be incurred and displayed on the console. If the number of demerit points is above 12, the program should display License Suspended."

        Console.Write("Speed Limit :");
        int speedLimit = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("SPEED LIMIT : " + speedLimit);
        Console.WriteLine("***********************");

        Console.Write("Car Speed : ");
        int carSpeed = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("CAR SPEED : " + carSpeed);
        Console.WriteLine("***********************");
        Console.WriteLine("***********************");

        int demeritPoints = 0;

        if (carSpeed &lt; speedLimit)
        {
            Console.WriteLine("Ok. You are good to go");
        }
        else
        {
            int speedDifference = carSpeed - speedLimit;

            for (int counter = 5; counter &lt;= speedDifference; counter += 1)
            {
                if (counter % 5 == 0)
                {
                    demeritPoints++;
                }
            }
        }
        Console.Write("Demerit Points :");
        Console.WriteLine(demeritPoints);

        if (demeritPoints &gt;= 12)
        {
            Console.WriteLine("Your license is suspended");
        }
        else
        {
            Console.WriteLine("You are not suspened");
        }
Not much to say I think, but here goes:


You're using clear, descriptive variable names, which is good. Such names make code easier to understand, which is especially important when you're working on large, complex projects.
Calculating the number of demerit points can be simplified to int demeritPoints = speedDifference / 5;.
Your code always displays the demerit points and suspension message, but from the requirements it looks like it should only do so when the speed exceeds the limit.
Instead of writing "SPEED LIMIT : " + speedLimit, you can use an interpolated string: $"SPEED LIMIT: {speedLimit}", which makes formatting a little easier.