Zookal
Zookal

We’d love to hear any feedback or comment from you!

© 2011-2021 Zookal Pty Ltd

View question and answer

From our collection of questions and answers
Engineering · Computer Science
Question details

Java Programming

. [40 marks] A train timetable for a train travelling between Vancouver and Toronto is given below Arrival Departure Day Station Vancouver Kamloops Jasper Edmonton Saskatoon Winnipeg Sioux Lookout | 05:0205:42 Hornepayne 15:3516:10 Capreol Toronto 20:30 06:00 06:35 16:0017:30 23:00 23:59 08:0008:25 20:45 22:30 2 2 2 4 4 5 00:1800:48 09:30 Store the information from each row of the table in an object. Then, arrange the objects in an ArrayList structure. Your program should now take the following commands in a continuous loop: I. Show-shows the full table II. Delay <station> <minutes> -the arrival of the train is delayed by <minutes> at station <station>; that is, add the delay to the corresponding station entry. For example, Delay Edmonton 30 implies that the train would arrive 30 minutes later than the expected time of arrival in Edmonton. The new entry would be Edmonton 23:30 00:29 3. All stations following Edmonton will also update their arrival and departure by +30 minutes, and consequently the day of arrival and departure as well. The result of this Delay command is shown belowStation Vancouver Kamloop:s Jasper Edmonton Saskatoon Winnipeg Sioux Lookout 05:32 06:12 Hornepayne 16:0516:40 Capreol Toronto Arrival Departure Day 20:30 1 06:00 06:35 16:00 17:30 23:30 00:29 08:3008:55 21:15 23:00 3 4 4 5 00:48 01:18 10:00 II. Quit - stop the program from accepting any more commands TrainTimeTable a Attributes + LinkedList<Station> schedule E Operations + public void delay(String station, int minute) public void displaySchedule(O Station Attributes + private Date ival +private Date departure + private int day +private String city Operations +public Date getArrivalDateO) +public Date getDepartureDate) + public int getDay0 public Station(String city, Date arrival, Date departure, int day) public String getArrivalO) +public String getcityO +public String getDepartureC +public void setArrivalDate(Date arrival) + public void setCity (String city) +public void setDay(int day) +public void setDepartureDate(Date departure) Please note that class Date and class “Calendar are mutable in Java. You are welcome to use either Date or Calendar, whichever seems easier for you to complete/solve the problem

Answer
Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.

Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.