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.
- 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
- User contact info is in the format first_name, last_name, email_address, subscribed.
For Example:Khan , Kasper, , Y
Could , Simon , , N
-
- Remove any leading or trailing whitespace from each field
- 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:
- ==================================================================
- To: postarica@example.com
- From: be@DevonAlp.edu
- Subject: Sweet Honey Sale for Valentines Day!
- 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 ==================================================================
-
- Use a StringBuilder to create the email string
- Make sure all the emails are in lowercase
- 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.
- 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.
- 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:
- 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 .
- Email missing @ symbol: Write an error message in the format:Address invalid: "". Missing @ symbol.
- 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
Get step-by-step solutions from verified subject matter experts
