

The values are accessed from the end location of the array and are concatenated in another string object and displayed as a text with the words reversed. The punctuations of the text are eliminated from the words and ultimately they are stored in a string array. BlueJ is available in the MacLab in /Applications/Bluej 2.0.5. We will use the BlueJ environment for this lab. In the lectures we talked about object oriented programming. The input text is broken into words using StringTokenizer class. Please review your lecture notes BEFORE you try to do this lab. String arr – The words of the text are stored here. StringTokenizer stk – break the input text into tokens. String str – Initial text is stored in this string objecty.īufferedReader br – Used to take input from user. ReverseSentence ss=new ReverseSentence() Public static void main(String args) throws IOException The first line of input contains a single integer N( =65 & s1.charAt(s1.length()-1)=97 & s1.charAt(s1.length()-1)=0 i–) That is, the lines are printed in reverse order.

‘right this solve will you smart are you If problem this illustrate to text of piece sample a is This’. If you are smart you will solve this right’. ‘This is a sample piece of text to illustrate this problem. For example consider the following input text: Your task is to print the words of the text in reverse order without a punctuation mark other than blanks.
#Bluej program change look full
The input here will consists of a number of lines of English text consisting of the letters of the English alphabet, the punctuation marks (‘) apostrophe, (.) full stop, (,) comma, ( ) semicolon, (:) colon and white space characters (blank, new line). Here is a string program on which changes the position of the words but not the alphabets.
