Question: URGENT! CODE IN JAVA! A flight is characterized by company, departure date, arrival date, departure airport, arrival airport. In main method add 3 flights to

URGENT! CODE IN JAVA!

A flight is characterized by company, departure date, arrival date, departure airport, arrival airport. In main method add 3 flights to a LinkedList, then add them to a HashSet (duplicate flights should be removed automatically) then add them to a TreeSet. Implement class Flight (with all required methods!) and main method. Implement a FlightRepository class that manages a collection of flights. Class should have methods for adding new flights, getting a flight (or a flight collection) company, departure date, arrival date, departure airport, arrival airport . Implement a method that returns a flight/ flight collection based on more than one field. Also implement FlightRepositoryI interface that exposes the methods in FlightRepository. Implement an AirController thread that continuously adds flights in a FlightQueue and an Airport thread that continuously removes flights from the FlightQueue and outputs details for each landed flight. Use producer-consumer pattern. Use explicit locks. Do not use blocking queues or other concurrent collections.

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!