I need a c++ program that reverses directions on a text file. It should read all
ID: 3638194 • Letter: I
Question
I need a c++ program that reverses directions on a text file. It should read all key words (left right straight west east north south), and replace them when it reverses the sentence. It should read the directions from a text file.For the case of input files containing driving directions (from point A to point b) reverse those directions and display the results (i.e the directions how to get from point B to point A)
I will have a text file with the following directions:
Start at 12345 Main Street, near the college starbucks. Go north for 2 miles. Then turn right at the intersection with Inspiration Avenue. Continue along Inspiration Avenue for 3.2 mniles, and turn left on the corner of Joy Street. After 1/4 mile on Joy street, arrive at Barnes and Noble.
The output would look something like this:
start at Barnes and Noble on Joy street. Go for 1/4 mile and turn right on the corner of Inspiration Avenue. Continue along Inspiration Avenue for 3.2 miles. Then, turn left at the intersection with main Street. Go south for 2 miles. Arrive at 12345 Main Street, near the college Starbucks.
I'm a TA at UCLA, and I'm tired of doing this projects. Help me out here.
Thank You
G
Explanation / Answer
Hi, my friend i can help u get the words out of the string but the complete program needs a little work and lots of ideas but this will help u this program implies the idea if u have an idea but u don`t know hot to program it message me and i will be glad to help u PLEASE RATE #include #include #include int main() { std::string token, text("Here:is:some:text"); std::istringstream iss(text); while ( getline(iss, token, ':') ) { std::coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.