DEVRY CIS 170 Entire CourseDEVRY CIS 170 Entire Course DEVRY CIS 170 C iLab 7 of 7 Sequential Files | Page 3

// determine how many splits there will be so we can size our array int ; for ( int ; i < theline . size ();=""> if ( theLine [ i ] == theDeliminator ) splitCount ++; } splitCount ++; // add one more to the count because there is not an ending comma // create an array to hold the fields string * theFieldArray ; string [ splitCount ]; // split the string into seperate fields string ; int ;
for ( int ; i < theline . size ();="" i ++){="" read ="" each ="" character ="" and ="" look ="" for ="" the =""> if ( theLine [ i ] != theDeliminator ) { theField += theLine [ i ]; // build the field } else { // the deliminator was hit so save to the field to the array theFieldArray [ commaCount ] = theField ; // save the field to the array ; commaCount ++; } } theFieldArray [ commaCount ] = theField ; // the last field is not marked with a comma ...
return theFieldArray ; } // end split Step 2 : Processing Logic Using the pseudocode below , write the code that will meet the requirements . The pseudocode for the writeData function is shown below . Start open the text file to append start do while loop Allow user to enter name store name ( using getline method ) Allow user to enter city store city ( using getline method ) . . write name , city , etc . to the file end loop close the file