2. Write email4.cpp from email4-algorithm.txt This program should have a list to
ID: 3770883 • Letter: 2
Question
2. Write email4.cpp from email4-algorithm.txt This program should have a list to store valid, non-duplicate email addresses. It should prompt the user for the input and output filenames, open and read the input file, and output to the console the valid email addresses, skipping duplicates. If a line contains the character @, create the variables s, e, and hasDot, and use loops to find their values, per the lecture on the term project. If the values for these three indicate that the @ is inside a valid email address, use a boolean search loop to see if that valid email address has already been found earlier in the file -- use case-independent comparisons. If it has not already been found, then add it to the list and output to the console screen. Here are some guidelines: If you open the output file, you are not doing this right -- this step is only needed in the final version of the project. If you do not create your own input files with which to test your program, you are not doing this right. If you do not test your program with the ten .txt files provided in the project writeup, and you see duplicate email addresses outputed, you are not doing this right. Compile and run the program. Submit the source file to the class website for credit. Remember in your final version of the project to remove the output of email addresses to the console screen as you add them to the list. In that version, output the email addresses after the EOF loop closes and you determine that the list of email addresses is not empty. Then you can output them in a loop that traverses the list -- one per line to the console, and semicolon-space delimited to the output file. Program I/O. The program should prompt the user for the input and output filenames, and then output the valid email addresses found, skipping case-independent duplicates. Example. Your program's console I/O should look something like this, excluding your introduction information: Enter input filename [default: fileContainingEmails.txt]: x.txt Enter output filename [default: x.txt]: y.txt Input file name is x.txt Output file name is y.txt Please press Enter key to continue: RBurns@dvc.edu vcolber@dvc.edu Number of valid email addresses is 2
Explanation / Answer
Program:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.