Question: Lists at _ bus _ stop and on _ board _ bus are read from input, representing passengers waiting to board a bus and passengers
Lists atbusstop and onboardbus are read from input, representing passengers waiting to board a bus and passengers on the bus, respectively. Perform the following tasks:
Remove the first element from onboardbus and output 'Passenger alighted: followed by the element.
Add all the remaining elements of atbusstop to the end of onboardbus.
Click here for example
Note: All passenger names are unique.
atbusstop inputsplit
onboardbus inputsplit
printfPassengers waiting at a bus stop: atbusstop
printfPassengers on board: onboardbus
printfUpdated passengers on board: onboardbus
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
