Question: In Java using Netbeans Goals Practice interfaces Description A delivery company has two methods of delivery - ground vehicles and air drones. The delivery area
In Java using Netbeans


Goals Practice interfaces Description A delivery company has two methods of delivery - ground vehicles and air drones. The delivery area is covered by a grid of roads stretching from north to south and from east to west every kilometer. A ground vehicle can move on the roads - along X axis or Y axis, whereas drone can fly directly to the destination. Both devices receive coordinates for delivery and relocate accordingly. The company keeps track of a total distance traveled to deliver all packages. Y 1,3 2, 3 3,3 1,2 2,2 3,2 1,1 2,1 3,1 X Introduce an interface to describe a delivery device with a method deliver Tocint x, int y). The method would return the distance traveled from the last position of the vehicle or drone to delivery destinatic Create two independent classes for ground and air delivery that implement the interface. The program should first accept a delivery type (either 'ground' or 'air') and a sequence of delivery destinations as a pair of coordinates terminated with the word "end": air 23 55 41 72 53 end The delivery starts from coordinates (0,0) and then visits all the destinations in the sequence. Travel distance for vehicle is destinationx - currentx| + | destinationy currenty|| Travel distance for drone is (destinationX - currentx)2 + (destinationy currenty)2 The program should print out the total distance traveled on the delivery route
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
