Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 36 Weeks Ago, 4 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
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
-----------