Question: In a Visual Studio, create a new project (C# Console Application (.Net Framework)) named YourFirstName_A2 (where YourFirstName is your first name, such as John_A2) to

In a Visual Studio, create a new project (C# Console Application (.Net Framework)) named YourFirstName_A2 (where YourFirstName is your first name, such as John_A2) to accomplish the following task: Jigisha Patel Page 2 of 4 CarType enum Create an enumeration named CarType to represent the types of car as follows: SUV Hatchback Sedan Truck Car Class This class consists of the following members. All the properties have public getters and no setters. Manufacturer : string o A string property to store manufacturer name such as Honda Make : int o An int property to store the making year of car such as 2018 Model : string o A string property to store the models name of the case such as Civic VI_NUMBER : int = 1021 o This is a static field help create unique Vehicle Identification Number for each car object. This number should be automatically incremented by 100 each time the constructor of this class is called. This field will be used to initialize the VIN field. VIN : int o This is a field represents unique Vehicle Identification Number for each car object which will be initialized from VI_NUMBER field. BasePrice : double o This property stores the base price of the car such as $35000.00 Type : CarType o This property stores type of the car such as Sedan. It must receive value of the CarType enumeration. Define the following constructors for this class: Car (string manufacturer, int make, string model, double basePrice, CarType type) o This constructor will assign received parameters to the respective class properties o It should also increment VIN by 100 Implement the following methods in the class: public static operator bool ==(Car first, Car second) o This method overrides the equality operator. This method will return true if the both the car objects have same manufacturer, model and type; otherwise, it returns false. This method will be used to compare two car objects. Jigisha Patel Page 3 of 4 public static operator bool !=(Car first, Car second) o This method overrides the not equality operator. This method is required by the compiler when the above method is implemented. It does the reverse of the above. This method will return false if the both the car objects have same manufacturer and model; otherwise, if either manufacturer, model or type is different, it returns true. This method is not used directly be any class. override string ToString() o this method should display all the car details in appropriate format. Dealership_Cars file This text file contains the car information that each dealership should have. The file records are structured using CSV format. The following is the sample record from file: DS_22_1, Toyota, 2019, Highlander, 49000.00, SUV In the record above, DS_22_1 indicates dealership ID to which the car belongs. The remaining are the car attributes which are self-explanatory. Dealership class This class consists of the following members. All the properties have public getters and no setters. CarList : List o This is property holds a list of cars that dealership has in stock. ID : string o A string property to store ID of each dealership such as D22_101 Name: string o A string property to store name of the dealership such as The Six Dealership Address: string o A string property to store the address of dealership such as 1029 Main Street, Toronto Define the following constructors for this class: Dealership (string ID, string name, string address) o This constructor will assign received parameters to the respective class properties o It will then open and read file named Dealership_Cars.txt which is provided with this assignment. o It will read one line at a time, and extract all the fields from the records. o If the first field obtained from each file record matches dealership ID provided as parameter in constructor, create an object of Car class with the help of remaining fields obtained from file record. o Add the created Car class object, to the CarList variable. Jigisha Patel Page 4 of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!