SissyDancheva / Vehicle-Rental-System

C# Console Application that calculates rental and insurance costs based on specific business rules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vehicle-Rental-System

C# Console Application that calculates rental and insurance costs based on specific business rules.

Table of Contents
  1. Getting Started
  2. About The Project

About The Project

C# Console Application that manages rental and return processes of different types of vehicles. Currently it works for Cars, Motorcycles and Cargo Vans. The user is not required to enter input, because the input values are part of the code. They can be found in the Main method in Program.cs

Getting Started

Currently the application runs locally so you need to download it on your computer or simply clone the repository.

Built with

  • C#

Output

The output consists of:

  • Date - same as the return date
  • Customer Name
  • Rented Vehicle
  • Reservation start date
  • Reservation end date
  • Reserved rental days
  • Actual return date
  • Actual rental days
  • Rental cost per day
  • Initial insurance per day
  • Insurance discount per day
  • Insurance per day - insurance discount subtracted from the initial insurance
  • Early return discount for rent - visible only if the vehicle is returned ahead of time
  • Early return discount for insurance - visible only if the vehicle is returned ahead of time
  • Total rent
  • Total insurance
  • Total - sum of total rent and total insurance

(back to top)

Car

car-info

Motorcycle

motorcycle-info

Cargo Van

cargoVan-info

(back to top)

Structure of the Project

car-info Class Structure
  1. Program.cs - the main logic is executed here: creating the instances of the classes.
  2. Vehicle.cs - base class with virtual methods that are shared amongst the derived classes:
    • Car.cs
    • Motorcycle.cs
    • CargoVan.cs
    • Each class implements its specific logic for the virtual methods based on certain criteria. For the cars the insurance is reduced if their safety rating is 4 or 5. Additional insurance is calculated if the driver is under the age of 25 and for cargo van drivers the insurance is reduced if their experience is more than 5 years.

      The rent cost is adjusted based on the rental period. Disounts are applied if the vehicle is returned ahead of schedule - the remaining days are 50% off.

  3. Invoice.cs - contains the logic to calculate the insurance and rental daily and total costs, also the insurance adjusting price.
  4. InvoicePrinter.cs - a dedicated class which holds the code that prints.

(back to top)

About

C# Console Application that calculates rental and insurance costs based on specific business rules.


Languages

Language:C# 100.0%