Question: Please do this in java [40 marks] A train timetable for a train travelling between Vancouver and Toronto is given below. Station Arrival Departure Day

 Please do this in java [40 marks] A train timetable for

a train travelling between Vancouver and Toronto is given below. Station Arrival

Please do this in java

[40 marks] A train timetable for a train travelling between Vancouver and Toronto is given below.

Station

Arrival

Departure

Day

Vancouver

20:30

1

Kamloops

06:00

06:35

2

Jasper

16:00

17:30

2

Edmonton

23:00

23:59

2

Saskatoon

08:00

08:25

3

Winnipeg

20:45

22:30

3

Sioux Lookout

05:02

05:42

4

Hornepayne

15:35

16:10

4

Capreol

00:18

00:48

5

Toronto

09:30

5

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:

Show shows the full table

Delay the arrival of the train is delayed by at 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 below:

Station

Arrival

Departure

Day

Vancouver

20:30

1

Kamloops

06:00

06:35

2

Jasper

16:00

17:30

2

Edmonton

23:30

00:29

3

Saskatoon

08:30

08:55

3

Winnipeg

21:15

23:00

3

Sioux Lookout

05:32

06:12

4

Hornepayne

16:05

16:40

4

Capreol

00:48

01:18

5

Toronto

10:00

5

Quit stop the program from accepting any more commands.

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.

TrainTime Table Attributes + LinkedList schedule Operations +public void delay(String station, int minute) + public void displaySchedule) TrainTime Table Attributes + LinkedList schedule Operations +public void delay(String station, int minute) + public void displaySchedule)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!