Question: Tip: Create a Class Library and add it to your project. C# Console Application Exercise: Car Rental Company Objective Develop a console application for a
Tip: Create a Class Library and add it to your project.
C# Console Application Exercise: Car Rental Company
Objective
Develop a console application for a basic car rental company using C# This application will demonstrate your understanding of inheritance, polymorphism, abstract classes, and interfaces through the creation, management, and operation of vehicles and customers within a rental system.
Task Description
Your program should manage vehicles a for a car rental company, with functionalities to addremove vehicles, and add rental periods to a vehicle
Setup Instructions
Project Structure: Create a new Console Application in C# Your solution should contain three files
Program.cs for the main class
Models.cs for your classes and interfaces
RentalManager.cs for managing the rental logic.
Define Models and Behaviors:
Interfaces and Abstract Classes: Use an interface IRentable for vehicles that can be rented, including methods like Rent and Return. Use an abstract class Vehicle to define shared attributes and methods of vehicles.
Create Two classes that extended Vehicle
Rental Management: Implement a class RentalManager to handle operations such as addingremoving vehicles, renting vehicles and displaying current vehicles
Detailed Instructions
Creating the Models Modelscs:
Define an abstract class Vehicle with properties like Make, Model, Year, Status, and Notes. Include virtual methods for displaying vehicle information.
Implement derived classes such as Car, Bike, etc., from the Vehicle class. Override methods as necessary to provide specific details.
Create an IRentable interface with methods Rent and Return. Ensure that your Vehicle classes implement this interface where applicable.
Managing Rentals RentalManagercs:
Implement methods for addingremoving vehicles
Include methods to display lists of vehicles and their current statuses and notes.
Console Application Logic Programcs:
Instantiate your RentalManager and use a loop to display a menu for the user to interact with, offering choices to manage vehicles
Ensure inputs are validated, and provide appropriate feedback to the user for each action
Include error handling for invalid inputs
Testing and Submission
Thoroughly test your application to ensure all functionalities work as expected. Pay special attention to the transition of statuses for both vehicles and customers through various operations.
Prepare your solution for submission, ensuring your code is wellcommented and follows C# coding conventions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
