Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction This will use Java Collection objects to generate random names. This is useful when you have production data with customer names in it, but

Introduction

This will use Java Collection objects to generate random names. This is useful when you have production data with customer names in it, but you need valid data in Dev/Test/Stage, but want to avoid having Personally Identifiable Information (PII) in these lower life cycles. You can use these random names to replace the PII data while copying the data from Production to these lower life cycles. (You also want to change addresses, birthdates, phone numbers, email, etc. but for this assignment we will focus on names). Students will then find all names that share common first names and display them.

Description

The program will need to perform the following tasks:

Display your name and email address as the first output

Load a list of First names and Last names from a file (2 files will be provided) and load these into a Collection object (again 2 different objects is suggested)

Generate 20 new unique names (meaning no duplicates) by randomly selecting a First Name and a Last Name

Sort this list of names by First Name and display on the screen

Sort this list of names by Last Name and display on the screen

Now find all instances of the new names that share a common first name (hint: a Map would be a really good object to use for this)

firstNames.txt

James Boba Wicket Boskk Han Luke Anakin Leia Rey Finn Poe Kylo

lastNames.txt

Tucker Fett Solo Skywalker Dameron Trooper Ren

Sample Run

Submitted by John Doe - jdoe@sample.com

Generated Names:

1. Rey Ren

2. Kylo Fett

3. Boskk Dameron

4. Finn Solo

5. Anakin Dameron

6. Anakin Fett

7. Boskk Fett

8. Wicket Trooper

9. Anakin Ren

10. Boba Solo

11. Wicket Tucker

12. Wicket Fett

13. Kylo Skywalker

14. Anakin Trooper

15. Luke Skywalker

16. Kylo Dameron

17. Luke Ren

18. Han Solo

19. Boskk Solo

20. Leia Skywalker

Sorted by First Name

Anakin Dameron

Anakin Trooper

Anakin Fett

Anakin Ren

Boba Solo

Boskk Fett

Boskk Solo

Boskk Dameron

Finn Solo

Han Solo

Kylo Skywalker

Kylo Fett

Kylo Dameron

Leia Skywalker

Luke Ren

Luke Skywalker

Rey Ren

Wicket Trooper

Wicket Tucker

Wicket Fett

Sorted by Last Name

Anakin Dameron

Boskk Dameron

Kylo Dameron

Anakin Fett

Boskk Fett

Kylo Fett

Wicket Fett

Anakin Ren

Luke Ren

Rey Ren

Kylo Skywalker

Leia Skywalker

Luke Skywalker

Boba Solo

Boskk Solo

Finn Solo

Han Solo

Anakin Trooper

Wicket Trooper

Wicket Tucker

Combine all names by First Name

Boskk

Dameron

Fett

Solo

Finn

Solo

Kylo

Dameron

Fett

Skywalker

Wicket

Fett

Trooper

Tucker

Boba

Solo

Han

Solo

Leia

Skywalker

Luke

Ren

Skywalker

Rey

Ren

Anakin

Dameron

Fett

Ren

Trooper

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the forces that influence how people handle conflict

Answered: 1 week ago