UML diagrams for Java Console Program
Flight.java
public class Flight {
private static final int MAX_PACKAGE_PER_FLIGHT = 10;
private String flightNumber;
private String destination;
private Package[] packages;
private int numPackages;
private String status;
public Flight(String flightNumber, String destiantion) {
this.flightNumber = flightNumber;
this.destination = destiantion;
this.packages = new Package[MAX_PACKAGE_PER_FLIGHT];
this.numPackages = 0;
this.status = "On Time";
}
public String toString() {
String result = "Flight Number: " + flightNumber + "\n";
result += "Destination: " + destination + "\n";
result += "Flight bStatus: " + status + "\n";
if (numPackages >0) {
result += "Contains " + numPackages + " package(s): \n";
for (int i = 0; i