In javaMake a program with classes named Vehicle, LandVehicle, AirVehicle, Car, Truck, Glider, Balloon, VehicleFactoryMain, MyFileManager. Put all files in a package named "vehicleActivity" The...


In javaMake a program with classes named Vehicle, LandVehicle, AirVehicle, Car, Truck, Glider, Balloon, VehicleFactoryMain, MyFileManager.


Put all files in a package named "vehicleActivity"


The Vehicle Inheritance looks like this:



Note: Vehicle should also have a range.



(1st img here)


Make sure to override the toString() method for returning a String that includes all the information about an instance of a vehicle.



VehicleFactoryMain will use these classes to make a random number and assortment of vehicle types.


For example:


Car - red, 526Km,1524Kg, 1988Kg, 1001Kg, gas, 4-wheels, 2-doors, fastback.


Balloon - orange, 234Km,320Kg, 423Kg, 256Kg, gas,  950m, hot air.



For the various ranges, altitudes, and weights set a max and min value and randomly choose between those.


For values that have types (hot-air, hydrogen, helium or gas, electric, diesel, kerosene, methane,none) make a static array in the class and randomly choose one of the values.


Have the factory select a random number between 2-5 inclusive for each type of vehicle.


It will then generate that many randomized versions of one of the types of vehicles.


Repeat this process for all 4 types of vehicles and store all of them in an ArrayList.


-----------------------------------------------------------------------------------------------------------------------------------------


The MyFileManager class will have three methods:


   clearFile(String fileName)


When this method is called, if the file with fileName exists, this method erases all text in the file.





   appendLine(String lineToPrint, String fileName)


   appendArray(ArrayList v, String fileName)


Anytime one of these methods is called, the file manager will check to see if the file exists. If it does, the String or array is appended to the list.


If the file does not exist, the MyFileManager creates it and writes to it.



All paths use just the file name so that the system will store and read/write them from the default path.


--------------------------------------------------------------------------------------------------------------------------------------------


After generating an array full of random vehicles, use your MyFileManager class to make a file named "VehicleProductionInventory.txt"


The text file will contain a header with the number of vehicles produced and the current date and time (ISO 8601 format).


Use metric measurements for all values



(2nd img)



Number of vehicles produced <insert number here><br>Date of production <insert current date and time><br>Car<br>red, gas, 450Km, 1524Kg, 4 wheels, 2-doors, fastback.<br>Balloon - orange, propane, 75Km, 320Kg, 950m, hot air.<br><and the rest of the list of all vehicles produced><br>etc<br>

Extracted text: Number of vehicles produced Date of production Car red, gas, 450Km, 1524Kg, 4 wheels, 2-doors, fastback. Balloon - orange, propane, 75Km, 320Kg, 950m, hot air. etc
Vehicle<br>color<br>weight<br>maxWeight<br>minWeight<br>fuelType<br>(animal-powered,<br>gas, electric,<br>diesel, kerosene,<br>methane)<br>LandVehicle<br>AirVehicle<br>numWheels<br>maxAltitude<br>numDoors<br>Car<br>Truck<br>Glider<br>cargoSize<br>Balloon<br>buoyantGas<br>bodyType<br>wingSpan<br>(sedan, fastBack,<br>coupe, convertable,<br>hatchBack)<br>maxSize<br>minSize<br>(hot-air,helium,<br>hydrogen)<br>cargoType<br>(openBed, BoxTruck,<br>van, minivan, dumpTruck)<br>

Extracted text: Vehicle color weight maxWeight minWeight fuelType (animal-powered, gas, electric, diesel, kerosene, methane) LandVehicle AirVehicle numWheels maxAltitude numDoors Car Truck Glider cargoSize Balloon buoyantGas bodyType wingSpan (sedan, fastBack, coupe, convertable, hatchBack) maxSize minSize (hot-air,helium, hydrogen) cargoType (openBed, BoxTruck, van, minivan, dumpTruck)

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here