Create a Vehicle class for keeping current set of coordinates and calculating the distance to new destination. The main class will have two vehicle objects, scan 5 sets of coordinates for 5 different deliveries and print which vehicle is chosen for it in the following format: x1 y1 vehicle number n x2 y2 vehicle number m etc Deliverables Submit a zip file of all of the NetBeans directory of your project. Incomplete projects, projects from different IDE, or separate code files will not be evaluated.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter20: Queuing Theory
Section: Chapter Questions
Problem 17RP
icon
Related questions
Question

In java using netbeans 

Description
A delivery company has two vehicles to serve an area covered by a grid of roads
stretching from north to south and from east to west every kilometer. At the beginning of
the day both vehicles start from position (0, 0). When a vehicle receives a set of
coordinates for delivery, it moves along the X and Y axis until it reaches the correct
position and stays there awaiting a new set of coordinates for new delivery.
The company has a dispatcher that chooses the closest between the two vehicles for
the next delivery. Upon receiving a new delivery destination, the dispatcher prompts
both vehicles for their respective distances from the required destination and assigns
the delivery to the vehicle with the shortest distance.
The distance is calculated as
|destinationX - currentX+ destinationY – currentY|
Y
1, 3
2, 3
3, 3
1, 2
2, 2
3, 2
1, 1
2, 1
3, 1
Transcribed Image Text:Description A delivery company has two vehicles to serve an area covered by a grid of roads stretching from north to south and from east to west every kilometer. At the beginning of the day both vehicles start from position (0, 0). When a vehicle receives a set of coordinates for delivery, it moves along the X and Y axis until it reaches the correct position and stays there awaiting a new set of coordinates for new delivery. The company has a dispatcher that chooses the closest between the two vehicles for the next delivery. Upon receiving a new delivery destination, the dispatcher prompts both vehicles for their respective distances from the required destination and assigns the delivery to the vehicle with the shortest distance. The distance is calculated as |destinationX - currentX+ destinationY – currentY| Y 1, 3 2, 3 3, 3 1, 2 2, 2 3, 2 1, 1 2, 1 3, 1
Create a Vehicle class for keeping current set of coordinates and calculating the
distance to new destination. The main class will have two vehicle objects, scan 5 sets of
coordinates for 5 different deliveries and print which vehicle is chosen for it in the
following format:
x1 y1 vehicle number n
x2 y2 vehicle number m
etc
Deliverables
Submit a zip file of all of the NetBeans directory of your project.
Incomplete projects, projects from different IDE, or separate code files will not be
evaluated.
Transcribed Image Text:Create a Vehicle class for keeping current set of coordinates and calculating the distance to new destination. The main class will have two vehicle objects, scan 5 sets of coordinates for 5 different deliveries and print which vehicle is chosen for it in the following format: x1 y1 vehicle number n x2 y2 vehicle number m etc Deliverables Submit a zip file of all of the NetBeans directory of your project. Incomplete projects, projects from different IDE, or separate code files will not be evaluated.
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr