Boost your Grades with us today!

This assignment will be to create work with an ArrayList of Cars to give you practice working… 1 answer below »

This assignment will be to create work with an ArrayList of Cars to give you practice working with ArrayLists of Objects.
Create a new project (NetBeans users, remember to make certain the “Create Main Class” check box is NOT checked.
Once your empty project has been created, download and copy the Car.java file attached to this assignment into your project (should go INSIDE of your project’s src folder).
Also download the attached cars.txt file and copy this file into your project (should go OUTSIDE of your project’s src folder).
Then create a new Driver/Main class for your project which should do the following:
cars.txt data is from –>> courses.washington.edu/hcde511/s14/datasets/cars.xls
The format is: make~model Modify Car to include an instance variable make. Create a getter/setter for the new instance variable. Make the appropriate updates to the full parameter constructor, toString() and equals() Create an ArrayList to hold Cars Create a Scanner to read from the cars.txt file Use a loop to create new Cars and put those Cars into your ArrayList. Data for the Cars should be generated by: Make: The first String from the cars.txt file (Hint: You may want to use the .split() method on String to create an array!) Model: The second String from the cars.txt file speed: randomly generate a value from 1 to 100 safetyRating: randomly generate a value from 1 to 10 [Your ArrayList will have the same number of Cars in it as there are cars in your cars.txt file] Use a separate loop to go through your ArrayList of Cars and determine the average accidentOdds value greater than 10.0 (use the accidentOdds()method!) Print out the value you calculated above Use a separate loop to go through your ArrayList of Cars and change all of the Cars safetyRating values to 10 Use a separate loop to go through your ArrayList of Cars and determine the average accidentOdds now that they are all very safe. Print out the value you calculated above. Use a separate loop to go through your ArrayList of Cars and change all of the Cars safetyRating values to 1 Use a separate loop to go through your ArrayList of Cars and determine the average accidentOdds now that they are all very unsafe.

Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!