Question: IN JAVA Problems: Drive safe! Lab 6: Here we aim to check the distance between cars and prompt an alert to the user if cars
IN JAVA

Problems: Drive safe! Lab 6: Here we aim to check the distance between cars and prompt an alert to the user if cars are about to crash into each other. Also, cars should be removed from the list if they are crashed into each other. (Use ArrayList) Program specification: Create a class called car to locate each car randomly (use small range to define your space) and calculate the distance between cars. If cars are closer than a threshold (ex. 10 meters), then alert the user and report the accident. Monitor the road traffic until there is at least one accident reported. In addition, your program should give the user an option to see the list of existing cars and their distance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
