Question: Integer numTime is read from input as the number of elements in the vector that follows. Perform the following tasks: Output Forward: . Use

Integer numTime is read from input as the number of elements in the vector that follows. Perform the following tasks:
Output "Forward: ".
Use a for loop to output all the elements in vector bikingLogs that are in order.
Output "Backward: ".
Use a for loop to output all the elements in vector bikingLogs that are in the opposite order.
In both loops, output a "-" after each element, including the last element, and end with a newline.
Ex: If the input is 4,131,194,153,172, then the output is:
Forward: 131-194-153-172-
Backward: 172-153-194-131-
Note: The second loop starts with i = bikingLogs.size()-1.

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 Programming Questions!