Question: hello, please can you solve this java I need it quckly please since there's no much time to submit [20 pts] Implement the class Ticket
hello,
please can you solve this java
I need it quckly please since there's no much time to submit

- [20 pts] Implement the class Ticket characterized by one String data field ticketNumber, a static integer data field ticketsCounter, an array trips of Trip objects, and the integer tripNumber. The methods are:
- A constructor that increments ticketNumbers by one, create the trips array, and generates a ticket number by concatenating TN with the current ticketsCounter. The maxNbTrip parameter is used for the size of the array trips
- A method addTrip(t: Trip) that adds a trip to the set of trips of this ticket if it was possible.
- A method reduceCost() that calls the economize method on every trip that could be economized.
- A toString() method that returns a description about the ticket containing all its information and the information of its trips in the form:
The ticket TN312 has the following trips:
1. A flight departing from Beirut, going to Paris for a basic price of 650$. The seat class reserved for this flight is economic.
2. A train trip departing from Paris, going to Barcelona for a basic price of 270$. It is a VIP reservation.
Implement the driver class (application) as follows:
- Create a ticket object of maxNbTrip = 100 and add to it a first-class flight trip from Prague to Vienna for a basic price of 150$ and another bus trip from Vienna to Venice for a basic price of 92$.
- Write code to display total cost of the ticket, then reduce the cost of the ticket.
- Write code to display the total cost of the ticket, which includes the cost of all the tickets trips.
- Write code to display the number of bus trips in the ticket.
Implement the below classes and interface as presented in the following UML diagram except the class BusTrip for which you will find the code provided below. For all classes implement only the getters that you will need later in your code. "Interface" Economical + economize(): void Ticket - ticket Number: String - ticketsCounter: int trips: Trip) - tripNumber: int + Ticket(maxNbTrip: int) + addTriplt: Trip): void + seduce Costo: void + toString(): String A Trip - departureCity: String - arrivalCity: String - basicPrice: double + Irin.de: String, ac: String, br: double) + salsulateCesto: double + toString(): String BusTrip + Bus Trin(de: String, ac: String, br: double) + toString(): String Flight - seatClass: String + Flights: String, ac: String, bp: double, seatClass: String) + toString(): String
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
