logo

import java.text.NumberFormat;.

   

Added on  2019-09-19

2 Pages229 Words139 Views
import java.text.NumberFormat;public class Itinerary {private Flight f1;private Flight f2;public Itinerary(Flight first) {f1 = first;f2 = null;}public Itinerary(Flight first, Flight second) {f1 = first;f2 = second;}public Flight getSecondFlight() {return f2;}public Flight getFirstFlight() {return f1;}public boolean hasConnection() {if (f2 == null) {return false;} else {return true;}}public double getTotalCost() {double total = 0;if (f2 != null) {total = f1.getCost() + f2.getCost();} else {total = f1.getCost();}return total;}public Time getDeparture() {return f1.getDeparture();}public Time getArrival() {return f2.getArrival();

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Java program for Fraction class, String and Date array, One Dimensional Array and Fantasy Football
|26
|6874
|98

ITECH7410 Software Engineering Methodologies
|12
|980
|92

Information Technology - Solved Assignment
|11
|2112
|36