View difference between Paste ID: L8R25wTa and
SHOW:
|
|
- or go back to the newest paste.
1 | - | |
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 | } |