|
@ -210,7 +210,7 @@ public class Administration { |
|
|
String UserId = null; |
|
|
String UserId = null; |
|
|
String UserName = null; |
|
|
String UserName = null; |
|
|
|
|
|
|
|
|
System.out.println("Enter the type of user (1-Student, 2-Admin, 3-Professor): "); |
|
|
|
|
|
|
|
|
System.out.print("Enter the type of user (1-Student, 2-Admin, 3-Professor): "); |
|
|
int userType = scanner.nextInt(); |
|
|
int userType = scanner.nextInt(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -218,9 +218,9 @@ public class Administration { |
|
|
while(!correctData) |
|
|
while(!correctData) |
|
|
{ |
|
|
{ |
|
|
System.out.println("Enter the User Details!"); |
|
|
System.out.println("Enter the User Details!"); |
|
|
System.out.println("Name: "); |
|
|
|
|
|
|
|
|
System.out.print("Name: "); |
|
|
UserName = scanner.next(); |
|
|
UserName = scanner.next(); |
|
|
System.out.println("ID: "); |
|
|
|
|
|
|
|
|
System.out.print("ID: "); |
|
|
UserId = scanner.next(); |
|
|
UserId = scanner.next(); |
|
|
|
|
|
|
|
|
//Checks if the entered id is already being used |
|
|
//Checks if the entered id is already being used |
|
@ -284,10 +284,6 @@ public class Administration { |
|
|
//creates a substring to check if the id-"syntax" is correct |
|
|
//creates a substring to check if the id-"syntax" is correct |
|
|
String substring = userId.substring(1); |
|
|
String substring = userId.substring(1); |
|
|
|
|
|
|
|
|
//if(substring == null || substring.isEmpty()) |
|
|
|
|
|
//{ |
|
|
|
|
|
// return false; |
|
|
|
|
|
//} |
|
|
|
|
|
for(char c : substring.toCharArray()) |
|
|
for(char c : substring.toCharArray()) |
|
|
{ |
|
|
{ |
|
|
if(!Character.isDigit(c)) |
|
|
if(!Character.isDigit(c)) |
|
|