A comprehensive C# application for managing different types of vehicles, including cars, trucks, boats, race cars, and luxury yachts.
.
├── Common # Common utility class for vehicle constants
├── Exceptions # Custom exceptions for vehicle validation
├── IndependentClasses # Utility classes for vehicle operations
├── Services # Service classes for file operations and vehicle management
├── Vehicles # Vehicle class implementations
├── UserInterface # Console-based user interface for vehicle management
├── Program.cs # Main application entry point
└── README.md # Project documentation
The system supports multiple vehicle types:
- Vehicle: Abstract base class for all vehicle types
- Car: Basic passenger vehicle implementation with horsepower and model
- Truck: Vehicle with cargo load capacity
- Boat: Water-based vehicle with seating capacity
- RaceCar: High-performance vehicle with turbo boost capability
- LuxuryYacht: High-end water vehicle with luxury features including helipad
- Airplane: Flying vehicle with altitude capabilities
- CargoAirplane: Specialized airplane for transporting cargo
- Train: Rail-based vehicle with multiple units
Custom exception classes for data validation:
- VehicleException: Base exception class for all vehicle-related exceptions
- InvalidPriceException: Thrown when vehicle price is invalid
- InvalidSpeedException: Thrown when speed values are invalid
- InvalidCargoCapacityException: Thrown when truck cargo capacity is invalid
Utility classes for vehicle operations:
- TaxCalculator: Calculates applicable taxes for different vehicle types
- VehicleComparer: Provides comparison functionality between vehicles
- VehicleStatistics: Generates statistical information about vehicle collections
Service classes for application operations:
- FileHandler: Manages reading and writing vehicle data to files
- VehicleManager: Core service for managing vehicle objects
- .NET 9.0+ SDK
- Visual Studio 2022 or VS Code with C# extensions
- Clone the repository
git clone https://github.com/aoof/vehicles-management-system.git - Open the solution in your preferred IDE
- Build the solution
dotnet build - Run the Program.cs file
dotnet runor to run testsdotnet run -t
- Install the linux release file from releases page
- Extract using unzip
unzip vehicles-management-system-linux.zip -d vehicles-management-system - Give execute permissions
chmod +x vehicles-management-system/vehicles-management-system - Run the application
./vehicles-management-system/vehicles-management-system
Note: MacOS generally has more security restrictions so save yourself the time and clone the repo and build the application yourself
- Ensure you have the latest version of .NET installed on your machine
- Install the macos release file from releases page
- Uncompress or extract using unzip
unzip vehicles-management-system-macos.zip -d vehicles-management-system - Run
dotnet vehicles-management-system/vehicles-management-system.dllto start the application (Additional security permissions may be required)
The Vehicle Management System provides a command-line interface for managing your vehicle collection:
-
Adding Vehicles:
- Select "Add Vehicle" from the main menu
- Choose a vehicle type (Car, Truck, Boat, etc.)
- Enter requested details for the specific vehicle type
-
Managing Vehicles:
- List all vehicles in the system
- Search for specific vehicles by name or type
- Update vehicle information
- Remove vehicles from the system
-
Data Operations:
- Save your vehicle collection to a CSV file
- Load vehicle data from existing files
- Export statistics about your vehicle collection
-
Advanced Features:
- Compare different vehicles by various properties
- Calculate tax liability for each vehicle
- Generate reports on vehicle value distribution
-
Comprehensive Vehicle Management:
- Create and manage different types of vehicles with specific properties
- Support for land, water, and air vehicles with specialized attributes
- Extensible framework for adding new vehicle types
-
Advanced Calculations:
- Calculate taxes based on vehicle type, price, and regional settings
- Generate statistics including average price, speed range, and type distribution
- Compare vehicles across multiple dimensions (speed, value, capacity)
-
Data Persistence:
- Save and load vehicle data from CSV files with comma-separated values
- Support for custom file locations and multiple save files
- Error handling for file operations with recovery mechanisms
-
Flexible Architecture:
- Object-oriented design with inheritance for vehicle types
- Service-based architecture for separation of concerns
- Custom exception handling for robust error management
This project is licensed under the MIT License - see the LICENSE file for details.