Question
Objective: implement Queue and Stack data structures in Java using Java collections. This assignment simulate DMV car registration in a simple scenario. We have several
Objective: implement Queue and Stack data structures in Java using Java collections. This assignment simulate DMV car registration in a simple scenario. We have several cars in a line (queue) and some license plates keeping in form of stack. We assign each car from the queue one license plate from the stack. Classes: Car, LicensePlates, Services, RegCar, Test DMV (You should use same name for you class name) ---------------------------------------- Class Car has 2 fields: ( 5 points) 1. brand String 2. color String a. constructor Class LicensePlates has 2 fields: ( 5 points) 1. plate String 2. State String a. Constructor Class Service has 2 methods : ( use same method signature) (20 points) 1) public Queue lineOfcars(Car c, Queue carQ) create a queue with cars object 2) public Deque stackOfplate(LicensePlates p,Deque carPstack) create a stack of license plates class CarReg has one static method : ( use same method signature) ( 15 points) 1) public static void register(Queue lineOfcars, Deque stackOfplate) picks up one car from queue and one license plate from stack and create an object with these two objects show message for brand and color and plate number and state class TestDMV has: ( 5 points) 1) main method 2) creates 4 car objects 3) creates a queue of cars 4) crates 4 License plate objcets 5) create a stack of plate 6) call register method from RegCar.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started