Question: Lab 6.4 Devon Alp Highschool Homework Assignment Note: the language used for this assignment will be java You Have been hired by MID to do

Lab 6.4 Devon Alp Highschool Homework Assignment

Note: the language used for this assignment will be java

You Have been hired by MID to do some processing on some data they have provided you. Follow the program specifications below to complete the homework.

  1. Read user contact info from an input file that has the following content

, YYan103 , King, , YBilek , Shazi, , YGreychen , SchwaOtz, , OCsrter , hhomas, , YDevon, Oc*an , , NTia , Escar, , Y

  1. User contact info is in the format first_name, last_name, email_address, subscribed.

For Example:Khan , Kasper, , Y

Could , Simon , , N

    1. Remove any leading or trailing whitespace from each field
  1. For each subscriber (contacts with a Y for subscribed), generate a personalized "email" and append it to an output file called YourEmails.txt with the following content:
  1. ==================================================================
  2. To: postarica@example.com
  3. From: be@DevonAlp.edu
  4. Subject: Sweet Honey Sale for Valentines Day!
  5. Hi jane Sow !

Bee sweet to your valentine (or yourself) this year! Buzz into the devon alp bookstore and buy a 3 oz bottle of spicy Honey for only $7.95. ,supplies are limited. das Honey Inc ==================================================================

    1. Use a StringBuilder to create the email string
    2. Make sure all the emails are in lowercase
    3. For contacts with a subscribed value of N, or anything other than Y, do nothing. Your code should treat uppercase Y and lower case y as the same.
    4. If only the first or last name appears, print only that specific name in the greeting. If the subscriber's first and last name are missing display Dear Valued Customer, in the greeting.
  1. Some lines of input have purposely been made invalid or incomplete. If one of the following conditions listed below happens , you do not need to generate a personalized email, rather, your code should output an error.

Here are some parameters below to consider:

  1. Your code should check for the following conditions for invalid input and report the error exactly as shown:
    • Missing email address: Write an error message in the format: Missing email address: Chester, Steve,, N .
    1. Email missing @ symbol: Write an error message in the format:Address invalid: "". Missing @ symbol.
    2. Invalid character in the first or last name (only capital and lowercase characters are allowed): Write an error message in the format: Invalid character '%' at position 4 in last name: "Robe%tson"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!