Advertisement
Guest User

Untitled

a guest
Sep 27th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.  
  2. public class test
  3. {
  4.     public static void updateUserTitle() {
  5.          
  6.         System.out.printf("\n");
  7.         System.out.println("Please enter a valid user ID: ");
  8.  
  9.         String titleInput = console.nextLine();
  10.         User foundUser = null;
  11.        
  12.         for (int i=0; i <= currentUsers; i++) {
  13.             if (titleInput == userArray[i].userID)
  14.             {
  15.                 foundUser = userArray[i];
  16.             }
  17.         }
  18.        
  19.         if(foundUser!=null)
  20.         {
  21.             System.out.println("Please enter the new name for the user: ");
  22.  
  23.                  String newName = console.nextLine();
  24.  
  25.                  empArray[i].username = newName;
  26.         }
  27.         else
  28.         {
  29.             System.out.println("User not found");
  30.         }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement