Question: C++ Write a function that receives an email in any of the formats in the original data and returns an email in the specified format.

C++

Write a function that receives an email in any of the formats in the original data and returns an email in the specified format. The email is to be complete including username, @, and domain.

In the original data,some of the emails have been abbreviated. If the email only has the username (no @ or domain), it is a student email account. In this case, add @student.mail to the username.

bilbo.baggins becomes: bilbo.baggins@student.mail 

If the email has the username, an @, and the first part of the domain, add .com at the end.

 bilbo.baggins@teacher becomes: bilbo.baggins@teacher.com 

Add the function prototype in the directories.h file.

 std::string FixEmail(std::string email); 

Write the function definition in the directories.cpp file.

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!