|
|
@ -223,6 +223,64 @@ public class Administration { |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
public boolean rightPrefix(String userId, int i) |
|
|
|
{ |
|
|
|
switch (i){ |
|
|
|
case 1: |
|
|
|
if(userId.startsWith("S")) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
else if(userId.startsWith("s")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital S!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else if(!userId.startsWith("S")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital S!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
if(userId.startsWith("A")) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
else if(userId.startsWith("a")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital A!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else if(!userId.startsWith("A")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital A!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
if(userId.startsWith("P")) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
else if(userId.startsWith("p")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital P!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else if(!userId.startsWith("P")) |
|
|
|
{ |
|
|
|
System.out.println("The ID needs to start with a capital P!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
System.out.println("Error"); |
|
|
|
break; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|