/* Programmer: Norfe R. Gregorio* Program name: Reverse* Subject: IT134_Computer Programming 3* Instructor: Mr. Dony Dongiapon* Date Started: 03/14/09 * Date Finished: 03/19/09* Purpose: The purpose of this proggram is to read the entered string of the user in reverse form*/
import java.util.*;public class reverse{ public static void main(String[] args){sring val;string value; Scanner scan = new Scanner(System.in); System.out.print("Please enter the word to be rverse: "); String value = scan.nextLine(); StringTokenizer val = new StringTokenizer(value); while(val.hasMoreTokens())
{ String element = tokens.nextToken(); StringBuffer buffer = new StringBuffer(word); element = buffer.reverse().toString(); System.out.print(word+" "); } }}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment