Parking Bill C Sharp Programming Exercise from Codility

--

This is a coding skills exercise from Codility

Given two strings representing times of entry and exit from a car parking lot, find the cost of the ticket according to the given billing rules.

In the below solution there are 3 files:

  1. Ticket.cs contains the code to the solution without following an object oriented approach (Method 1)
  2. ParkingTicket.cs that contains the code to the solution with an object oriented approach (Method 2)
  3. Program.cs is the console application that calls the above 2 methods depending on the choice of the user.

The above solution uses .NET 6 as the framework.

User input and Input validation have been added as extra feature although not in the scope of the problem statement.

Coding has been done using Visual Studio 2022 Community edition and all warnings and messages from the output window have been addressed.

--

--

Siddharth Phatarphod

Full Stack | Angular| .Net| .Net Core| SQL | Azure PaaS | Azure DevOps | Git | Scrum