SatelliteHelper

This contains the main method that will be called by the user who will supply all the instance values and a total simulation time.



Please replace the body of the orbit method with this:


if (simulationTime <= 0){
			throw new IllegalArgumentException("Enter a simulation time (in seconds) greater than 0.");
		}

		int time = 1; //this is t (time in seconds)		
		final int totalOrbitTime = 106 * 60; //total orbit time in seconds
		Satellite satellite = new Satellite(x, y, vx, vy);

		for (int i = 1; i <= simulationTime; i++){
			simulateFlight(satellite, time);

			if (satellite.hasCrashed()){
				//reset velocity
				satellite.setVX(0);
				satellite.setVY(0);

				System.err.println("Sorry the satellite has crashed!");
				return;
			}

			if (i == 60){
				printOutputValue(satellite);
			}
			
			if (i == totalOrbitTime) {
				//satellite has completed the orbit around the Equator
				System.err.println("Equator orbit succesfully completed.");
				return;
			}

			time ++;
		}