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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education