Advertisement
StefanTobler

Lesson 33 Activity 1

Dec 3rd, 2016
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. /*
  2.  * Lesson 33 Coding Activity 1
  3.  Write a method that takes an array of Strings and changes the Strings to UPPER CASE.
  4.  
  5.  This method must be called upper() and it must take a String[] parameter.
  6.  */
  7.  
  8.  
  9. import java.util.Scanner;
  10.  
  11. class Lesson_33_Activity_One {
  12.  
  13.     public static void upper(String cas[])
  14.     {
  15.      for(int i = 0; i < cas.length; i++)
  16.      {
  17.        cas[i] = cas[i].toUpperCase();
  18.      }
  19.     }
  20.    
  21.     public static void main(String[] args)
  22.      {
  23.       String test[] = {"hi","hello","mean","yo","apple","Mac"};
  24.       upper(test);
  25.       for (int i = 0; i < test.length; i++)
  26.       {
  27.         System.out.println(test[i] + " ");
  28.       }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement