Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER IN JAVA!!!!!!!!!!!!!! Create a class called UserInfo that will enable a user to register an account within a database. The registration must include

PLEASE ANSWER IN JAVA!!!!!!!!!!!!!!

image text in transcribed

image text in transcribed

image text in transcribed

Create a class called UserInfo that will enable a user to register an account within a database. The registration must include the following information: Name Address 0 Once registration is complete, you will then prompt the user for a username and password. Following this, you will then encrypt the user's password. You will store the registration information in a class named UserInfo, with appropriate instance variables, accessor/mutator methods, and a toString() method. You will also incorporate methods to handle the encryption of the password, as indicated below: You must provide an encrypt (String) method, which correctly encrypts its String parameter and returns the corresponding encrypted String. The method must have the following signature: public String encrypt (Strings) Your driver class MUST invoke the encrypt method. C You must provide the following methods for each encryption step: o o O removeWhitespaceAndConvertToUpper substitute swapHalfs ForEncrypt swapFirst2WithLast2 swapMiddleChars Each of the above methods MUST have a string parameter and return a String. In other words, the method signatures for these methods are the same as for the encrypt method but with a different method name. At the end of your program, you must display the information for the user, INCLUDING the encrypted password. NOTE: You may NOT store the unencrypted password in your standalone class. You may store the encrypted version. You will be penalized if you store the unencrypted password in your standalone. The Encryption Process Below is the description of each step of the encryption process. Where necessary an example is given to clarify the process described in the step. 1. Remove any leading or trailing whitespace from the line. 2. Convert all letters in the string to UPPERCASE. Step 2 Input Line: "abcdefghijklmnopqrstuvwxyz" Step 2 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 3. Perform the following character substitutions: Original Substitution A @ E I ! J ? O P # R & S $ T V X % (space) * + A 4. Move the first half of the string to be the last half. (Note: for lines of odd length the line must be divided such that the first half being moved contains one more character than the last half.) Example 1 (even number of letters): Step 4 Input Line: Step 4 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "NOPQRSTUVWXYZABCDEFGHIJKLM" Example 2 (odd number of letters): Step 4 Input Line: Step 4 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXY" "NOPQRSTUVWXYABCDEFGHIJKLM" 5. Swap the first 2 characters of the line with the last two characters. Step 5 Input Line: Step 5 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "YZCDEFGHIJKLMNOPQRSTUVWXAB" 6. Swap the two characters immediately to the left of the middle of the string with the two characters immediately to the right of the middle of the string. (Note: for lines of odd length the line must be divided such that the first half contains one more character than the last half.) The middle is a position between the first half and the last half. Example 1: Step 6 Input Line: Step 6 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKNOL MPQRSTUVWXYZ" Example 2: Step 6 Input Line: Step 6 Output Line: "ABCDEFGHIJKLMNOPQRSTUVWXY" "ABCDEFGHIJKNOLMPQRSTUVWXY" Below gives an example of applying all six steps sequentially to the alphabet string: Encryption Input Line: Encryption Output Line: abcdefghijklmnopqrstuvwxyz "LM#Q&$+U^W%@BYZCD=FGH!?KN*

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Explain the service recovery paradox.

Answered: 1 week ago