Assignment Details Part 1: Adding car information input methods Whichever car you choose to model, certain information about it will need to be input such as its make/model, year released (must be a positive number), trim, MPG (must be positive), and the type of car (restrict this to: Truck, Sedan, Coupe, Station Wagon, or Van). Think carefully about appropriate datatypes for the information listed, then start by adding a static method to: - Prompt for the model of the car and return what was entered by the user. You'll need to use the Scanner class to read this in (e.g., Corolla, RAV4, Camry, etc. are some examples). Now add a main method and call the method written above and ensure that it works. (TIP: after writing each method detailed below, call it from the main to ensure it works \( -\cdots \) don't write ALL the code and then run it wake it one method at a time and don't proceed until you get it working). Next, add static methods to:
Next, add static methods to: - Prompt for the car's release year; keep prompting until the user has entered a valid year (i.e.: can't be 0 or negative). Once a valid year is entered, return it. - Prompt for the car's trim and return it; note that 'trim' is a car manufacturer label indicating which features are included in the car (for example: DX, LX, WRX, Sport, etc. are some sample trims). The user should be able to enter as many of these as they like (including 0 ) and the application should store each one. This should suggest a certain certain datatype (hint: don't pack them all into a single string). - Prompt for the type of car; acceptable inputs for the car type include: Truck, Sedan, Coupe, Station Wagon, or Van. If the user doesn't input one of these, keep prompting until they enter one of the types listed. Once a valid car type is entered, return it. Consider using an enum datatype to represent the valid types of cars (this is not required for this assignment). - Prompt for the car's MPG (miles per gallon); keep prompting until the user enters a valid (non-negative) input then
If a given method returns a value, save it in a local variable within the main. Part 2: Saving and printing car information Lastly, add the following static methods (these should only be called from the main method): - combine, which takes as input all the information returned from the previous methods and and returns it all in a single string (in the string this method returns, each piece of information should be separated by a newline). - write, which takes a string containing the combined information (returned from the above method) and writes this string to a file called 'car.txt' (use exception handling - i.e.: try-catch). - read, reads the contents of the 'car.txt' file line by line, printing out each line using System.out (use exception handling). Handin Instructions:
Part 2: Saving and printing car information Lastly, add the following static methods (these should only be called from the main method): - combine, which takes as input all the information returned from the previous methods and and returns it all in a single string (in the string this method returns, each piece of information should be separated by a newline). - write, which takes a string containing the combined information (returned from the above method) and writes this string to a file called 'car.txt' (use exception handling - i.e.: try-catch). - read, reads the contents of the 'car.txt' file line by line, printing out each line using System.out (use exception handling). Handin Instructions: Export your project to a .zip file and submit the .zip on canvas. You can do this through IntelliJ by going to File \( > \) Export \( > \) Export to Zip File. You should verify that you've submitted the correct .zip file (download, unzip it, and check). It is your responsibility to ensure you've turned in