Skip to main content
Logo image

Section 24.5 Practice Your Multidimensional Arrays!

The program below reads a text, word by word, from the file "reverseText.txt", which is located on our code server. It then stores this text in an array of strings (thus a two-dimensional array of characters) and subsequently prints this text to the screen.

Activity 24.1.

Your first job is to write a function printText(), to which you pass the array of strings as well as the number of words stored in the array, and which prints the text to the screen (thereby making the corresponding lines in the main function redundant: you can delete those lines).
You may notice that the text makes no sense. Your second job, therefore, is to print the text in reverse. You only have to reverse the order of the words, not the characters in an individual word. Please use a function printReverseText() for this purpose.

admin.....open in new window

When you are done, please paste your code into the code submission box below: