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

  1. The average top speed of electric, petrol and all vehicles.
  2. The top five vehicles in terms of range, weight, carry capacity, and top speed for petrol, electric and all vehicles.
  3. 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

Petrol

Vehicle01

1500

35

12

24.9

65

4

For Electric Vehicles

Electric

Vehicle02

2500

30

10

22.1

40

0

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

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!