From 5454451a5700e1fff8a65899f60c40b38b4b4248 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Thu, 8 Feb 2024 14:44:23 +0100 Subject: [PATCH] refactoring: registerUser Feature Layout in the console --- src/main/java/org/example/Administration.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 4b8a8db..4711b99 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -210,7 +210,7 @@ public class Administration { String UserId = 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(); @@ -218,9 +218,9 @@ public class Administration { while(!correctData) { System.out.println("Enter the User Details!"); - System.out.println("Name: "); + System.out.print("Name: "); UserName = scanner.next(); - System.out.println("ID: "); + System.out.print("ID: "); UserId = scanner.next(); //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 String substring = userId.substring(1); - //if(substring == null || substring.isEmpty()) - //{ - // return false; - //} for(char c : substring.toCharArray()) { if(!Character.isDigit(c))