Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ : This software stores all the data in array . Each person has SSN and name information. This information is provided in separated files.

C++ :

This software stores all the data in array. Each person has SSN and name information. This information is provided in separated files.

This is the data of a sample file:

i 586412373 NICOLA EVANGELISTA i 177228167 MEAGAN LEKBERG i 586412373 JEFF DUTTER i 760846483 KITTY MANZANERO i 061899135 CATHERIN MCCREIGHT i 087300880 CARMA KULHANEK i 177264549 VALERY KOSAKOWSKI i 210044984 SHEILAH MONGES d 760846483 KITTY MANZANERO r 760846483 KITTY MANZANERO r 007980295 DELPHIA SIMISON i 493515916 VERONIKA TADENA d 401991909 MCKINLEY WESTERFELD i 793267575 TEMIKA MESHEW i 319373939 MARGIT EBLIN

AN EXAMPLE OF RUNNING PROGRAM

ashk ./a.out 15-idr

The Number of Valid Insertation :10

item numbers in the Array Size is :9

Array Size is :500

In above file, each row represents one persons information. The leading character is either i, d, or r. The second column is the SSN of the person, the following string are the first name and last name.

This project will provide the basic following operations for the data in the array:

Insertion. The software adds the data to the end of the data in the array. If the provided data has duplicated SSN with an existing entry, the software will discard the provided data. Otherwise, increase the insertion counter by one.

-The character i means insertion. The software should insert the SSN and name to the end of the data in the array. However, the software will NOT insert personal information with duplicate SSN. For example, the first row and the third row have duplicate SSN. The information of the first person will be added, but the third will not.

In this project, we store the data in the array. Here are several requirements for the array:

-The initial size of the array is 1000.

-When you add a new entry to the array, if the array is not full, add the entry. If the array is full, creates a new array with doubled size. Copy the data from the old array to the new array. Release the old array.

CREATE THE INSERTATION METHOD

-insert() method which inserts data to the end of the array. If the provided data has duplicated SSN with an existing entry, the software will discard the provided data. Otherwise, increase the insertion counter by one.

USE:

-main() method:

int main(int argc, const char * argv[]) { fstream input(argv[1]);

.

.

.

while(!input.eof()){ input }

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

7 How should HRM practitioners approach conflict in the workplace?

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago