Algorithm for Assignment 6 First loop through the file, line by line, reading into a 1-dimensional character array input line buffer. Then we'll copy the words, filling up the lines as much as possible in a 2-dimensional character array output buffer. 1) Clear output buffer and intialize variables 2) Loop through input file line by line 2.1) Clear input line buffer and intialize line variables, read input line 2.2) Loop through input line word by word (see words.p) 2.2.1) If blank line and we haven't just done a blank line 2.2.1.1) If not at the very start (no paragraph breaks at the beginning of file), advance output buffer line index 2 places, (new paragraph) 2.2.2) Else if we have a word 2.2.2.1) If it doesn't fit on current line, advance line pointer in output buffer 2.2.2.2) Copy word to output buffer and update output buffer line position 2.2.2.3) If not at end of line in output buffer, add a space 3) Remove blank lines from end of output buffer (reduce line count) At this point output buffer should have proper paragraph breaks and be left justified. We'll loop through the output buffer line by line, and justify the lines by copying to a 1 dimensional character array line work buffer, adding extra spaces along the way. After each line is finished, we'll copy it back to the output buffer. 4) Loop through output buffer line by line 4.1) Initialize line variables 4.2) If on a blank line, or next line is blank (end of paragraph), we need to skip it, go back to top of loop 4). (continue statement) 4.3) Count spaces between words and spaces at end 4.4) If no end spaces, skip line. (Go back to top of loop 4) 4.5) Calculate extra spaces needed per gap, and spaces left over. 4.6) Loop through output buffer line char by char 4.6.1) If we hit a gap (space) add extra spaces to line work buffer 4.6.2) If we have left over spaces, add one of those as well and reduce count 4.6.3) If not on a gap, just copy the character to line work buffer 4.7) Copy the line work buffer back to the output buffer. Now the output buffer should be ready, we'll write it to the output file. 5) Loop through output buffer line by line 5.1) Write line to output file Good luck!