When a user signs in for the first time to a website the


When a user signs in for the first time to a website, the user has to submit personal information, such as user_id, name, email address, telephone number and so on. Typically, there are two fields for passwords, requiring the user to enter the password twice, to ensure that the user did not make a typo in the first password field. 

Write a class encapsulating the concept of processing a form with the following elements:

User_id

Password

Reenter password

Email address

Name

Street Address

City

State

Zip

Telephone

You will store these values as strings in an array. 

Write the following methods in your class:

1. A constructor with one parameter, an array of 10 strings (representing one element for each of the fields above), the only instance variable.

2. Accessor, mutator, toString methods

3. A method checking that no Strings are empty. If at least one is empty, return false; otherwise return true.

4. A method returning the number of characters in the user_id

5. A method checking if the two Strings representing the password fields are the same, if they are return true, otherwise false.

6. A method checking if the email address contains one and only one @ character and contains at least one "." after the @ character. If these conditions are met, return true; otherwise return false.

Write a test client to test all your methods in your class.

Solution Preview :

Prepared by a verified Expert
Business Economics: When a user signs in for the first time to a website the
Reference No:- TGS02227959

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)