Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ help! -Read all of the email addresses in the input file as strings into a 1-dimensional string array. Once weve read in each of

C++ help! -Read all of the email addresses in the input file as strings into a 1-dimensional string array. Once weve read in each of the emails (each email will be on its own line in the file and will span a row of the array), we will then extract the username part of the email and store it in another 1-dimensional string array (example: sample@ku.edu turns into sample). From there, we will output the usernames from the array to the console and to an output file. Since we dont know how many email addresses to expect, use an overly large array and treat it as a partially-filled array. Because were practicing with arrays, make sure the input file is closed before you do any outputting (this will force us to store the info in arrays). include:

#include  #include  #include  -We want to use the .find and .substr methods to extract the username part of the email addresses. 

***Sample Output

If this is the contents of our input file:

mrs.gloriamackenie@outlook.com

shand_lee@yahoo.com.hk

franklinosayandescott@gail.com

westernunion1233@yahoo.fr

Then both the console output and the output files contents will be:

mrs.gloriamackenie

shand_lee

franklinosayandescott

westernunion1233

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago