The program should be able to register two types of car owners: people and businesses. For both owners, following should be registered:

  • Name and address
  • Car that is owned, or that the owner doesnt own a car at the moment

For the car owners that's people, following should be registered:

  • Social Security Number (doesn't have to be a real security number, but should be a field that's registered nontheless).

For the car owners that's companies, following should instead be registered:

  • Company number (same as above, doesnt have to exist, but should be a inputted field that goes into the system)

For each car, following data should be registered:

  • Registration number
  • Car name and type (Characteristics) (for example: Ferrari Testarossa)
  • Year first registered

Operations to be performed by the program:

  • register a new car owner of the type of person or company
  • register a new car and the owner of this (car owners and any vehicles they own)
  • remove the car from a register (the car owner should then be left in the registry until it might be removed)
  • remove the car owner, but only allowed to perform when they do not own a car
  • extract data for the owner of a car with given characteristics
  • change ownership of a car (change owners)

For each of the registration operations relevant data is read from the user. Social Security will identify individuals and business registration number to identify the firms. Upon registration of a new car owner the program have to prevent the new owner gets the same person or enterprise number as a car owner that has already been registered by the program. Similarly, the characteristics of cars identify vehicles, so the program must prevent double registration of the same type of car.

In the case of ownership, the program must read inputted registration number of a car that will change owner, as well as personal or business registration number for a new owner. If the new owner is not registered in the past, it must be registered before ownership can be implemented. Any reading of the data shall be made the "safe" way, ie using try-catch (Note: Use try-catch with resources!) And/or test that the text fields for the required data is filled out.

Each time the application is completed, all data stored in the application's data structure is printed to a file for storage. At startup, any file with the stored data is read and placed in the application's data structure. (Use object serialization, and, respectively, ObjectOutputStream and ObjectInputStream when printing to file and reading from file and programs separate window to listen.)

It is a requirement in this paper that for car owners to define a class hierarchy with an abstract class that contains what is common to both types of car owners, while they are defined by non-abstract subclasses of the abstract class. For the register of car owners do not use array as data structure, but instead should be made a separate list class that contains the list of car owners and methods that make the necessary operations on this list.

Project Extension

You will now create a new and expanded version of the program you made in a). In this version, it should be possible for every car owner to own more cars, with no limit on how many it is. Otherwise, the same data should be recorded.When printing the car registry, all data from cars a car owner owns should be printed. To avoid double registration of car owners, you should organize your application's data structure in the form of a list of lists. This means that in addition to the class list for car owners to generate a corresponding list for the class of cars, so that every car owner object has its own car list object. This includes vehicles owned by that car owner. (The list will be empty if they do not own any car at the moment.)

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.