Switching between strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Katie87
    New Member
    • Oct 2007
    • 9

    #1

    Switching between strings

    Hey, i have to write a program in which we will apply the same code to 5 different strings. The thing is were not allowed to write the code more than once, and our output has to be given for each string. Does anyone know how to do this?
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Use a function that accepts a String argument?

    Comment

    • Katie87
      New Member
      • Oct 2007
      • 9

      #3
      Originally posted by Ganon11
      Use a function that accepts a String argument?
      I'm just beginning java, i havent learnt anything about string arguments yet, do you know how to do it with loops maybe?

      Comment

      • dav3
        New Member
        • Nov 2006
        • 94

        #4
        Ask user for input.

        Capture their input and store it in a string.

        Pass the string to a for loop.

        Comment

        Working...