-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlightTest.java
More file actions
50 lines (40 loc) · 1.96 KB
/
FlightTest.java
File metadata and controls
50 lines (40 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Date: 06-NOV-2019
* Programmer: Dan Hopp
* Description: Test the Flight class. Do:
• Create a default Flight object called flight1.
• Print description of the flight1 object.
• Create a Flight object called flight2 with the following data:
Airline Name Flight Number Flight Origin City Flight Destination City
--------------------------------------------------------------------------------
UML U234 Chicago London
• Print description of the flight2 object.
• Create a Flight object called flight3 with the following data:
Airline Name Flight Number Flight Origin City Flight Destination City
--------------------------------------------------------------------------------
Java J817 Atlanta Paris
• Print description of the flight3 object.
• Print the number of flight objects created.
*/
package lab7;
public class FlightTest {
public static void main(String[] args) {
//Create a default Flight object called flight1
Flight flight1 = new Flight();
//Print the description of the flight1 object
System.out.println(flight1 + "\n");
//Create a Flight object called flight2 with "UML", "U234", "Chicago",
//"London"
Flight flight2 = new Flight("UML", "U234", "Chicago", "London");
//Print the description of the flight2 object
System.out.println(flight2 + "\n");
//Create a Flight object called flight3 with "Java", "J817", "Atlanta",
//"Paris"
Flight flight3 = new Flight("Java", "J817", "Atlanta", "Paris");
//Print the description of the flight3 object
System.out.println(flight3 + "\n");
//Print the number of flight objects created
System.out.println("Total number of flight objects created: "
+ Flight.getFlightCount());
}
}