my objective for this piece of code is to read in 2 lines i.e
My name is John Smith.
I live in Boston, Massachusetts
and get the second word of the first line "name" and the second last word of the second line "Boston," and then print them out as
name Boston,
question 1 :
is there some syntax issue in the while loops from 24 to 29 and 30 to 35 because i get nothing printed. so string secondword and secondlastword are both empty.
question 2 :
any better way of accomplishing the objective besides the method above.
doesn't work i cant seem to be able to get the second last word of the second line. i changed my code so i could get the second word of the first line as follows though.