Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

FOR C++ Write a program that will create userids for email addresses of a company. Names of employees will be contained in a file. Your

FOR C++ Write a program that will create userids for email addresses of a company. Names of employees will be contained in a file. Your task is to read the file character by character. Employee names are separated by semicolons. The process of creating a userid is as follows:

The first 8 characters, excluding spaces and non-alphabetical characters becomes the userid. Your program will therefore ignore all spaces and non-alphabetical characters from the input file. If the employee name excluding spaces and non-alphabetical characters consists of less than 8 characters, the userid will also contain less than 8 characters. (e.g. JG Smit will give a userid of jgsmit and GM Bezuidenhout will give a userid of gmbezuidenhout.

You will however not work with the full surname. Your program will read character by character, and form the userid as you go along, adding each new character of the id to the output file. Call the output file userid.dat. As soon as you read a semicolon, the previous userid is complete and you can then write the semicolon to the output file to separate the userids. You therefore have to plan the logic properly, so that you dont have to go back to the output file to delete characters that should not be there.

Create an input file called employee.dat with the following data: SS van der Merwe;PJ Ferreira;HW du Plessis;DF Kodisang;AA Papoudopolous;G Mhlanga;TRF Schoeman;LJ Marais-Le Roux;CG Roux;B Nicholaidis;TT Tshabalala;RV Mississipi;

Allow the user to specify the name of the input file.

NB: First plan your program on paper (using your computational thinking to do so). You have to submit your plan for your program as well as the actual program code, input and output. Planning your program can take the form of a flowchart, pseudocode, or notes to guide you in the development of the program.

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago