Question
Write c# Program in Windows Form to Load and Parse the XML configuration files for vehicles. The program should be able to handle badly formed
Write c# Program in Windows Form to Load and Parse the XML configuration files for vehicles. The program should be able to handle badly formed files or errors in the data in a suitable manner without crashing the program. Need to create XML files for testing purposes.
Permanently stores the data in the SQLite database file. That is, the XML file created would be loaded in the SQLite Database to allow user to run the following queries
- The average top speed of electric, petrol and all vehicles.
- The top five vehicles in terms of range, weight, carry capacity, and top speed for petrol, electric and all vehicles.
- How long a chosen vehicle running at top speed could run for. (Assume range is constant regardless of any other factor).
Each vehicle is either powered by a petrol or electric engine and the configuration details are stored in a separate XML file for each vehicle. All vehicles have a unique ID, a range (in metres), a weight (in Kilograms), a carrying capacity (how much weight they can support in kilograms), and a top speed (in meters per second). Petrol vehicles also have specifications of a noise level (in decibels) and the number of cylinders their engine has, whilst electric vehicles have specifications of the engine voltage (in volts) and a binary value indicating whether the motor is brushless or brushed (0 for brushless and 1 for brushed). An example layout of the XML file is as follows :
For Petrol Vehicles
For Electric Vehicles
These specifications are then stored in two of three database tables in an SQLite database. The database schema is shown below :
Table : Vehicle
vehicleID varchar(20) (Primary Key)
engine varchar(20)
range integer
weight integer
carryCapacity integer
topspeed real
Table : Petrol
vehicleID varchar(20) (Primary Key)
noise integer
cylinders integer
Table : Electric
vehicleID varchar(20) (Primary Key)
voltage integer
brushed integer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started