Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
String Manipulation - Exercise in Using String Manipulation Techniques

This assignment is an exercise in using string manipulation to edit and reformat input fields.  Some fields have patterns, some expect numeric values … possibly with limits.  Some fields are required (and cannot be just spaces), some are optional or conditionally optional, some will cause abends if null is not expected.  Strings need to be trimmed of leading and trailing blanks, shifted to upper- or lower-case or capitalized.

This is also an exercise in creating and using reusable code … code usable by multiple projects.

Wherever you see “XX”, replace it with your initials

  1. Create a XXValidationclass with the following static methods:
    1. XXCapitalize – this takes a string parameter and returns a string. Return an empty string if the input is null or empty.  It should trim leading and trailing spaces, and change the first letter of each word (if it is a letter) to upper case and the remaining letters in each word to lower case.  Watch 1-letter words.

    2. XXRegistrationCodeValidation - This takes a string and returns a Boolean.If the incoming string is null or an empty string, pass it.  Otherwise, return true if the string is 10 characters long and contains exactly 5 upper-case letters and 5 numbers separated by a hyphen “-“: “DOGGG-00012” & “BIRDD-10054” are both valid.

    3. XXPhoneNumberValidation– this takes a string and returns a Boolean.  If the incoming string is null or empty, pass it.  Otherwise, return true only if the entire string fits the phone pattern “123 123 1234” or “123-123-1234”. Note for the space separator or dash separator, either one can be used but not both (e.g. 123 123.1234 would be incorrect).

    4. XXPostalValidation – this takes a string by referenceand returns a Boolean.  If the incoming string is null or empty, pass it.  Otherwise, return true only if the string’s entire content fits the Canadian postal pattern “A2A 2A2” ... accept upper or lower case, with or without the single space. 
  1. Create the following form, naming it cs

  1. Buttons:
    1. Pre-Fill” loads the form with validdata … making it easier to test individual field errors.
    2. “Submit” edits the current data on the form and reformats the fields back onto the form.
      1. All validation errors are displayed together on the form in a red label, rich text box or in a message box … one line per error, with focus to the first field in error.
    3. “Clear” clears the form and resets the registration date to today.
  2. Tab sequence should be from top to down, then left to right for the buttons.
  1. Perform the following validations (all fields are optional unless specified otherwise).  All error messages are to be shown at once, one line per error, focus moved to the first field in error.
    1. A non-blank Registration Code is required.  Use XXRegistrationCodeValidation to check for invalid code and return any error messages.
    2. Pet name is required.
    3. Owner’s “Full name” is required and must contain more than one name (eg First Name and Last Name).
    4. “Address” is not required if “City/Town” is populated.
    5. Use your XXPhoneNumberValidationmethod to verify all phone number(s)
    6. If an email is provided, Cell Phone is not required - otherwise Cell Phone is required.
    7. The email must be a valid email pattern, if provided. There’s a MailAddress class in the Net.Mail namespace that throws an exception when instantiatedwith an invalid email address.  There’s also a plethora of indecipherable regular expressions out there.
    8. The province code, if provided, must be exactly two letters, not just two characters.  Accept upper- and lower-case.  
    9. The Registration Date cannot be in the future.
    10. The Postal code is required. Use XXPostalValidation to validate the postal code.

  2. Perform the following data conversions
    1. Use your XXCapitalizemethod to format the Address, City/Town and Pet and Owner’s Name fields.
    2. Shift the province code to upper case.
    3. Shift the email to lower case.
    4. Display the Date in the format shown – MMM dd, yyyy

support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close