Question: RU BusStop ( 2 5 points ) . Serena, a freshmen at Rutgers just finished her Intro to Logic class on College Ave and needs
RU BusStop points Serena, a freshmen at Rutgers just finished her Intro to Logic class on College Ave and needs to return to Busch for her Intro to Computer Science class. She is currently standing at the Yard Bus Stop, waiting patiently for her desired bus to arrive. Your job is to help Serena find in which order that bus will arrive!
Because we only covered char at this point in the semester all busses routes names are character in length. We cannot have BHe or REXB routes.
See Rutgers bus routes below, where some are fictitious.
A RouteB RouteC RouteE RouteF RouteH RouteL RouteR RouteX Route
Write the program BusStop.java that reads n char arguments from the command line.
The first n characters refer to the order in which the buses will arrive at the bus stop.The last char refers to the bus Serena is waiting for.
The program is expected to display the order in which the bus Serena is waiting for will arrive. If the bus Serena is waiting for does not stop at the bus stop then the program displays
To read the first character from the command line use:
char c argscharAt;
To read the nth character from the command line use:
char c argsncharAt;
You will have to read an undetermined number of characters, so you will need a loop to read all characters from the command line.
Hint:
Read the first n values and store them into a char D array.
Then, read the last char in the command line, and
Search for that value in the char array.
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
