Question: C++ please Write a program whose input is the name of a file that contains valid email addresses, one per line. The program then parses

C++ please

Write a program whose input is the name of a file that contains valid email addresses, one per line. The program then parses and outputs each domain and username. Example: suppose the file "input1.txt" contains

pooja@piazza.com drago12@uic.edu javiar_g@hotmail.com 

If the program is given the filename "input1.txt", the program outputs the following to the console:

piazza.com, pooja uic.edu, drago12 hotmail.com, javiar_g 

Your solution should use the parseEmailAddress function written in the previous exercise. If the input file does not exist, output "**file not found", otherwise process the contents of the input file; assume the input file contains one or more valid email addresses.

main.cpp

// // HW #02-3: program to parse a file containing email addresses, outputting the // domains and usernames. //

#include #include #include

using namespace std;

// // parseEmailAddress: // // parses email address into usernam and domain, which are // returned via reference paramters. // void parseEmailAddress(string email, string& username, string& domain) { // // TODO: // username = ""; domain =""; return; }

int main() { string filename; cout "; cin >> filename; cout

return 0; }

C++ please Write a program whose input is the name of a

Output differs. See highlights below. Input Please enter a filename> some_university.edu, testing 123 piazza.com, pooja uic.edu, dragol2 hotmail.com, javiar_g unknown.org, unknown b, a , Please enter a filename> some_university.edu, testingl23 piazza.com, pooja uic.edu, dragol2 hotmail.com, javiar_g unknown.org, unknown b, a Expected output uic.edu, drago12

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!