Question: Write a Java program that generates a password for each employee in a company using their name, surname and a special number entered by the

 Write a Java program that generates a password for each employee

Write a Java program that generates a password for each employee in a company using their name, surname and a special number entered by the user. Assuming a name has n characters and a surname has s characters, the password of each employee will be generated using the below rule:

Password =First(n/2)CharactersOfName+ First(s/2)CharactersOfSurname +SpecialNumber+ (LastDigitOfSpecialNumber^2);

Traverse the employee list using a for-loop.

For each employee:

Name and surname will be entered as String.

Special number will be entered as integer and its length cannot be larger than 6.

You can use a while-loop for controlling this part.

The strength information of the generated password will be kept in a corresponding variable (e.g. weak, medium, strong). A password within length range: [12] is considered to be strong.

The number of passwords belong to each corresponding strength and the shortest (weakest)/longest (strongest) passwords should be printed at the end (see sample outputs).

Enter the number of employees Enter your name and surname: gizem kayar Enter your special number: 333 The generated pass word for gizem kayar is: gika3339 Medium password Password generator info dialog: of weak passwords: 0 of medium passwords: 1 of strong passwords: 0 The weakest password is: gika3339 The strongest password is: gika3339 Enter the number of employees. Enter your name and surname: Enter your special number: 22 The generated password for su as is: sa224 Weak password Enter your name and surname: gizem kayar Enter your special number: 333 The generated pass word for gizem kayar is: gika3339 Medium password Enter your name and surname: hamid ahmadloue Enter your special number: 100000000 Enter your special number: 66778 he generated password for hamid ahmadlou is: haah Strong password Password generator info dialog: of weak passwords: 1. of medium passwords: 1 of strong passwords: 1 The weakest password is: sa224 The strongest password is: haahmad6677864

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!