import java.text.NumberFormat;.

Added on -2019-09-16

| 2 pages
| 340 words

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 2 pages

import java.text.NumberFormat;public class Flight {Plane plane;String flightNumber;double flightCost;Time departureTime;int durationTime;Airport sourceAirport;Airport destinationAirport;public Flight(Plane plane, String flightNumber, double flightCost, Time departureTime, int durationTime,Airport sourceAirport, Airport destinationAirport) {this.plane = plane;this.flightNumber = flightNumber;this.flightCost = flightCost;this.departureTime = departureTime;this.durationTime = durationTime;this.sourceAirport = sourceAirport;this.destinationAirport = destinationAirport;}public Plane getPlane() {return plane;}public String getNumber() {return flightNumber;}public double getCost() {return flightCost;}public Airport getDestination() {return destinationAirport;}public Time getDeparture() {return departureTime;}public Time getArrival() {Time arrivalTime = new Time(departureTime.getHour(), departureTime.getMinute());arrivalTime.addMinutes(durationTime);return arrivalTime;}

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this