Question: Output: James Q2Write a C++ program that reads a list of words from a text file into a vector of strings, sorts the words in



Output:
James
Q2Write a C++ program that reads a list of words from a text file into a vector of strings, sorts the words in descending alphabetical order, and then writes the sorted list to another text file. Assume that both the input and output files are formatted with only one word on each line. An example file input/file output pair is provided below: Input file: Output file: Jim Ted Ted Raachel Paula Paula Helen Jim Rachel Helen Hint: You may use bubble sort (from lecture or selection sort (from homework 3). However, you must rewrite the sorting algorithm to work on a vector of strings. Note: You must write your code in a source file named sort list.cpp. In your code, you must read from a text file named list in.txt and write to a text file named list_out.txt. You are provided an example input text file to test your code. Use the string and vector types that are accessible when you include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
