Question: Please help solve this question sol.txt provided Space ship class: import java.util.List; /** * The Class Spaceship is used to store the spaceship details of



Please help solve this question sol.txt provided
Space ship class:
import java.util.List; /** * The Class Spaceship is used to store the spaceship details of a player. */ public class Spaceship { /** The name. */ private String name; /** The current health. */ private double currentHealth; /** The maximum health. */ private double maximumHealth; /** The number of artifact. */ private int numberOfArtifact; /** The number of wins. */ private int numberOfWins; /** The current planet. */ private Planet currentPlanet; /** The all planets. */ private static List allPlanets; /** * Instantiates a new spaceship. * * @param name the name * @param maximumHealth the maximum health * @param numberOfWins the number of wins */ public Spaceship(String name, double maximumHealth, int numberOfWins) { this.name = name; this.maximumHealth = maximumHealth; this.numberOfWins = numberOfWins; this.currentHealth = maximumHealth; this.currentPlanet = new Planet(null, 0, 0); } /** * Gets the name. * * @return the name */ public String getName() { return name; } /** * Sets the name. * * @param name the new name */ public void setName(String name) { this.name = name; } /** * Gets the current health. * * @return the current health */ public double getCurrentHealth() { return currentHealth; } /** * Sets the current health. * * @param currentHealth the new current health */ public void setCurrentHealth(double currentHealth) { this.currentHealth = currentHealth; } /** * Gets the maximum health. * * @return the maximum health */ public double getMaximumHealth() { return maximumHealth; } /** * Sets the maximum health. * * @param maximumHealth the new maximum health */ public void setMaximumHealth(double maximumHealth) { this.maximumHealth = maximumHealth; } /** * Gets the number of artifact. * * @return the number of artifact */ public int getNumberOfArtifact() { return numberOfArtifact; } /** * Sets the number of artifact. * * @param numberOfArtifact the new number of artifact */ public void setNumberOfArtifact(int numberOfArtifact) { this.numberOfArtifact = numberOfArtifact; } /** * Gets the number of wins. * * @return the number of wins */ public int getNumberOfWins() { return numberOfWins; } /** * Sets the number of wins. * * @param numberOfWins the new number of wins */ public void setNumberOfWins(int numberOfWins) { this.numberOfWins = numberOfWins; } /** * Gets the current planet. * * @return the current planet */ public Planet getCurrentPlanet() { return currentPlanet; } /** * Sets the current planet. * * @param currentPlanet the new current planet */ public void setCurrentPlanet(Planet currentPlanet) { this.currentPlanet = currentPlanet; } /** * Sets the planets. * * @param allPlanets the new planets */ public static void setPlanets(List allPlanets) { Spaceship.allPlanets = allPlanets; System.out.println("Loaded solar system from sol.txt:"); for (Planet planet : Spaceship.allPlanets) { System.out.println(planet.toString()); } } @Override public String toString() { return String.format("Spaceship's name: %s Current health: %.1f Number of alien aritfact found: %d", name, currentHealth, numberOfArtifact); } /** * Move to. * * @param planetName the planet name */ public void moveTo(String planetName) { int index = currentPlanet.findPlanet(planetName, allPlanets); if (index
(c) Filelo FileIO.java contains the following two methods for the first question. You must figure out if the methods are static or non-static. 1) A method loadSpaceship This method takes as input a filename as a String parameter, and returns a new Spaceship, using the oonstructor defined in the Spaceship class The loadSpaceship method must use a FileReader and a BufferedReader to open the file specified by filename. Make sure to have two catch blocks to catch both FileNotFoundException and I0Exception when reading from the file. In these cases, throw an IllegalArgunentException with an appropriate error message that the file was not found, or that there was another error Note that the catch block for the FileNotFoundException must be above the catch block for the I0Exception to this to work properly Example player.trt and enemy.tzt files are provided with the assignment. The format of these files is exactly this, one value per line: . Name of the spaceship Maximum health Number of wins so far in the spsce game Use these values from the file to create and return a new Spaceship. Do not use the Scanner class. 2) The loadPlanets method. This method takes a filename of planets to read, and returns an ArrayList of Planets. An example of a file containing planets is found in the provided files as sol.txt. Read the file indicated by themethod parameter filenaze, by using a FileReader and a BufferedReader to open the file specified by filename. Do not use the Scanner class. Make sure to have two catch blocks to catch both FileNotFoundException and IQException when reading from the file. In these cases, throw an IllegalArgusentException with an appropriate error message that the file was not found, or that there was another error. Note that the catch block for the FileNotFoundException must be above the catch block for the IOException for this to work properly