Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Blue Pelican Java Project 11... please help

Name: Anonymous 2007-09-26 1:47 ID:AkvBcXjS

Write a program that will allow a user to input his name. The prompt and input data would look something like this:
Please enter your name. Peter Ustinov

Using a for-loop and the String method, substring(...), produce a printout of the reversal of the name.

For example, the name Peter Ustinov would be:
vonitsu retep

Notice that the printout is in all lower-case. Use the String method, toLowerCase() to accomplish this.

and btw this book can be downloaded here: http://www.bluepelicanjava.com/downloadBook_bpj.htm

Name: Anonymous 2007-09-26 9:17 ID:Heaven

ENTERPRISE.

import java.io.*;
import java.util.*;

public class ClassOne
{
    public static void main (String args[])
    {
        Scanner kbReader = new Scanner(System.in);
        System.out.println("Enter your name.");
        String name = kbReader.nextLine().toLowerCase();

        for (int j=name.length()-1; j>0; j--)
            System.out.print(name.charAt(j));

        System.out.println();
    }
}


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List