Task - Command Line Arguments - Flight Tickets #32
Replies: 26 comments 2 replies
|
|
`import java.util.; class AirTicket{ } public class PassengerOnboarding { } |
|
|
|
class AirTicket { } public class PassengerOnboarding { } |
|
`import java.text.ParseException; class AirTicket { } public class CommandLineArg { } |
|
|
|
`package File_Handling; } } |
|
import java.util.Date; class AirTicket{ } public class PassangerOnboarding { } // OUTPUT MODIFIED PASSANGER DETAILS |
|
|
|
|
|
Flight Booking `import java.text.DateFormat; class AirTicket { } public class PassengerOnboarding { }` |
|
class AirTicket { } class PassengerOnboarding { } |
|
`class AirTicket { } public class PassengerOnboarding { } |
|
class AirTicket { } public class PassengerOnboarding { } |
|
|
|
|
class AirTicket { } public class PassengerOnboarding { |
|
` class AirTicket { } public class PassengerOnboarding { } |
|
|
class AirTicket { } public class Commandargs { } |
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Declare a class AirTicket that contains three String data members: passenger, source, and destination. It has a parameterized constructor, getters, and setters.
In a driver class PassengerOnboarding, create an instance of AirTicket class. Also, declare a Date data member dateOfJourney in the driver class which receives the date of journey in the dd-mm-yyyy format as a command-line argument. Create a Date object to represent the date of the journey.
Print the details of the journey, i.e. doj along with the details of the ticket.
All reactions