Results 1 to 3 of 3
  1. #1
    Weisbrod220 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Having trouble with this program, help greatly appreciated

    I have been working on this for awhile now and I can't figure out how to do this: I have to make this program able to read in any string a user inputs, for now it just reads in Elephant, and converts it to an all caps vertical line, I need it to be able to do this for any string inputted by a user. Any help will be greatly appreciated. Thank you

    Here is what I have:


    import java.util.Scanner;

    import java.util.Random;

    public class HW3
    {
    public static void main(String[] args)

    {
    String s = "Elephant";


    System.out.println(Character.toUpperCase(s.charAt( 0)));

    System.out.println(Character.toUpperCase(s.charAt( 1)));

    System.out.println(Character.toUpperCase(s.charAt( 2)));

    System.out.println(Character.toUpperCase(s.charAt( 3)));

    System.out.println(Character.toUpperCase(s.charAt( 4)));

    System.out.println(Character.toUpperCase(s.charAt( 5)));

    System.out.println(Character.toUpperCase(s.charAt( 6)));

    System.out.println(Character.toUpperCase(s.charAt( 7)));
    }
    }

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,923
    Rep Power
    5

    Default Re: Having trouble with this program, help greatly appreciated

    Check out the String JDK API documentation.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Weisbrod220 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Re: Having trouble with this program, help greatly appreciated

    Thanks Jim that helped!

Similar Threads

  1. Replies: 1
    Last Post: 02-21-2013, 08:20 PM
  2. Help would be Greatly Appreciated.. please
    By aejames23 in forum New To Java
    Replies: 6
    Last Post: 11-04-2012, 11:54 PM
  3. Replies: 5
    Last Post: 10-24-2012, 08:17 PM
  4. Replies: 5
    Last Post: 12-08-2011, 08:54 PM
  5. Java Calculator Help Would Be Greatly Appreciated
    By TommyR in forum New To Java
    Replies: 1
    Last Post: 03-14-2011, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •