Question: Answer the following question? Consider the class diagram provided in Figure 1. Name one method that is over-ridden in the EconomyTicket class. [1 mark] __________________________________________________________________

Answer the following question?
- Consider the class diagram provided in Figure 1. Name one method that is over-ridden in the EconomyTicket class. [1 mark]
__________________________________________________________________
- What does it mean to over-ride a method in java? [2 marks]
-
This question relates to the UML diagram provided in Figure 1.
- Given the following 2 lines of code:
- 1 TrainService ts = new TrainService(ByronBay, Central, 10:00);
- concessionTkType = new TicketType(TicketType.CONCESSION);
- State whether the following lines of code are valid or not: [3 x 1 marks]
- Ticket tk = new Ticket(ts, concessionTkType);
- ANS ____________________________________________________
- FIrstClassTicket fct = new FirstClassTicket(ts, concessionTkType);
- ANS ____________________________________________________
-
- FirstClassTicket fctik = new Ticket(tk, concessionTkType);
-
ANS ____________________________________________________
- For each of the above lines of code give a reason for why they are/are not valid [3 x 1 marks]
- ANS
Ticket date Expiry: Date datelssued: Date service: Train Service ticketPrice: double ticketType: TicketType + getService(): TrainService + getTicketPrice(): double + issue Concession Ticket(): double + issue FullPrice Ticket(): double + issue Ticket(): double + print(): void setService (TrainService): void setTicketTypeTicketType): void + Ticket(TrainService, TicketType) + toString(): String Economy ClassTicket Economy ClassTicket(Train Service, TicketTyp + getTicketPrice(): double + toString(): String FirstClassTicket seatNumber: String SURCHARGE: double = 0.25 travelDate: Date + FirstClassTicket(TrainService, TicketType, Date + getTicketPrice(): double setSeatNumber(String): void setTravelDate(Date): void + toString(): String
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
