Computer Science Homework Help
Written in C. In this laboratory, you will create a program to be able to represent a vehicle register, ie a register of vehicles and their owners. Your customer is the Swedish Transport Administratio
Written in C. In this laboratory, you will create a program to be able to represent a vehicle register, ie a register of vehicles and their owners. Your customer is the Swedish Transport Administration, which has the task of keeping track of all vehicles that are in traffic in Sweden. In this first version, the vehicle register shall have a text-based interface. The data and functions that are to be included in the program are described below.
Data:
Type PersonThis type should be used in the program to store information about the owner of a vehicle. The information we need in this situation is the owner’s name and age.
Vehicle typeA vehicle must have the characteristics vehicle type, brand, registration number and owner. All these properties should have values when a vehicle is created.
FeaturesA vector with space for 10 vehicles must be created at the beginning of the program and if a register is stored on file, this must be loaded into the vector. Then a menu is displayed where the following options can be selected:
Add a vehicleIn a function, information about the vehicle and its owner must be entered from the user and the vehicle entered in the register. Check that the register is not already fullRemove a vehicleIn a function, a vehicle at a specified position must be removed from the register. Check that the position is validSorting by car brandIn a function, the register must be sorted in alphabetical order by car brand.Print information about a vehicleIn a function, information about a vehicle at a specified position must be printed. Check that the position is valid.Print the entire vehicle registerIn a function, information about all vehicles in the register must be printed.EndWhen the user chooses to quit, the register must be written to a file
Requirements for the program code• Safe entry• No magic numbers• No global variables• File management must be in a separate c-file• All standard header files, type declarations, function prototypes etc. must be includeda custom header file• Functions must not be “too long”