DEVRY CIS 170 C I L AB 7 OF 7 S EQUENTIAL F ILES Check this A+ tutorial guideline at sequential-files.

Slides:



Advertisements
Similar presentations
1 11/3/08CS150 Introduction to Computer Science 1 Reading from and Writing to Files Section 3.12 & 13.1 & 13.5.
Advertisements

Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
1 10/29/07CS150 Introduction to Computer Science 1 Reading from and Writing to Files Section 3.12 & 13.1 & 13.5.
1 10/25/06CS150 Introduction to Computer Science 1 Reading from and Writing to Files.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
STREAMS AND FILES OVERVIEW.  Many programs are "data processing" applications  Read the input data  Perform sequence of operations on this data  Write.
Credit Union National Association Installing and Uploading Project Zip Code.
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
1 Working with MS SQL Server Textbook Chapter 14.
Relational Databases (MS Access)
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Computer Programming TCP1224 Chapter 13 Sequential File Access.
5 1 Data Files CGI/Perl Programming By Diane Zak.
Instructions.  Open up the letter that Adam has given to you  Format it so it look professional.
) Main Menu: You can access all aspects of the database from this screen 2) Contacts: You can access the “contact database management” side of.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Files A collection of related data treated as a unit. Two types Text
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
REEM ALAMER REVISION FOR C LANGUAGE COURSE. OUTPUTS int main (void) { int C1, C2; int *p1, *p2; C1 = 8; p1 = &C1; C2 = *p1 / 2 + 5; p2 = &C2; printf ("C1.
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
CIS 170 MART Peer Educator/cis170mart.com FOR MORE CLASSES VISIT
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
DEVRY CIS 321 iLab 2 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 321 iLab 2 Check this A+ tutorial guideline at For more classes visit
DEVRY CIS 115 Week 7 Lab Fireworks Stand Checkout Check this A+ tutorial guideline at
DEVRY COMP 122 Lab 4 Lab Report and Source Code Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 2 OF 7 D ECISIONS Check this A+ tutorial guideline at decisions For.
DEVRY CIS 170 C I L AB 3 OF 7 L OOPING Check this A+ tutorial guideline at looping For more.
DEVRY CIS 170 C I L AB 4 OF 7 F UNCTIONS Check this A+ tutorial guideline at For.
DEVRY CIS 170 C I L AB 5 OF 7 A RRAYS AND S TRINGS Check this A+ tutorial guideline at
DEVRY CIS 170 C I L AB 6 OF 7 M ENU -D RIVEN A PPLICATION Check this A+ tutorial guideline at
CIS 115 Slingshot Academy / cis115.com
Excel Tutorial 8 Developing an Excel Application
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Computing Fundamentals
Beginning C++ Programming
Intro to PHP & Variables
CIS 170 Possible Is Everything/snaptutorial.com
CIS 170 Education for Service-- snaptutorial.com.
CIS 115Competitive Success/tutorialrank.com
CIS 170Competitive Success/tutorialrank.com
PRG 410 Competitive Success-- snaptutorial.com
CIS 115 Lessons in Excellence-- cis115.com. CIS 115 All Exercises Devry University (Devry) For more course tutorials visit CIS 115 All.
CIS 170 Lessons in Excellence-- cis170.com. CIS 170 Entire Course (Devry) For more course tutorials visit CIS170C All iLabs 1,2,3,4,5,6,7.
CIS 115 Education for Service-- tutorialrank.com.
CIS 170 Education for Service-- tutorialrank.com.
PRG 410 Education for Service-- snaptutorial.com
CIS 170 Teaching Effectively-- snaptutorial.com
PRG 410 Teaching Effectively-- snaptutorial.com
CIS 170 Education for Service-- cis170.com. CIS 170 Entire Course (Devry) For more course tutorials visit CIS170C All iLabs 1,2,3,4,5,6,7.
Designing and Debugging Batch and Interactive COBOL Programs
Lab 1 Introduction to C++.
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Python I/O.
Topics Introduction to File Input and Output
Arrays Kingdom of Saudi Arabia
Today’s Lecture I/O Streams Tools for File I/O
Lab 1 Introduction to C++.
CIS16 Application Development and Programming using Visual Basic.net
Functions continued.
Arrays Arrays A few types Structures of related data items
Reading from and Writing to Files
Topics Introduction to File Input and Output
Reading from and Writing to Files
IS 135 Business Programming
4.1 Introduction Arrays A few types Structures of related data items
Presentation transcript:

DEVRY CIS 170 C I L AB 7 OF 7 S EQUENTIAL F ILES Check this A+ tutorial guideline at sequential-files For more classes visit CIS 170 C iLab 7 of 7 Sequential Files Lab # CIS CIS170C-A7 Lab 7 of 7: Sequential Files Lab Overview - Scenario/Summary You will code, build, and execute a program that requires sequential files to create an address database. Learning Outcomes Continue using a menu system with console applications Be able to write a console application Demonstrate entering, appending, storing, and retrieving records Be able to write lines of output to a text file in order to create a reportDeliverables Section

Deliverable Points Step Program Listing and Output 45 Lab Steps Preparation: If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home. Locate the Visual Studio 2010 icon and launch the application. Lab: Step 1: Requirements: An Address Database Create a C++ console application that will store and retrieve names and addresses in a text file. The program should do the following. It should accept a series of names and addresses from the console. The user's input should be written to a text file in the CSV format described in the lecture, but do not include the field names in the first row of the file. Read the records from the text file, and display them in a user-friendly format. Provide a menu to allow the user to

append records to the file, display the records, or exit the application. Build upon the code below to complete the assignment. //Specification: Append and display records in a address database #include #include #include using namespace std; void menu(void); void writeData(void); void readData(void); string * split(string, char); const char FileName[] = "TestAddress.txt"; int main () { menu(); return 0; } //end main void menu(void) {

//allow user to choose to append records, display records or exit the program }//end menu void writeData(void){ //Write the Address Info to a file }//end write data void readData(void){ //read data from a file //use the split function to break a //deliminated line of text into fields }//end read data string * split(string theLine, char theDeliminator){ //Break theline into fields and save the fields to an array. //Each field will occupy one element in a character array. //theLine is a string with fields separated with theDeliminator character. //Assumes the last field in the string is terminated with a newline. //Useage: string *(lineBuffer, ','); //determine how many splits there will be so we can size our array int ;

for(int ; i 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 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 End The program input should appear similar to this. Append Records Name John Smith Street Union Ave City Any Town State TX Zip Code "Enter another Record? (Y/N) "

The file structure should look like this. John Smith, 902 Union Ave, Any Town, TX, Eric Jones, 345 State Way, Fresno, CA, The file output should appear similar to the following. Show Records __________________________________________ Record #1 Name John Smith Street Union Ave City Any Town State TX Zip Code __________________________________________ Record #2 Name Eric Jones Street State Way City Fresno State CA __________________________________________

Zip Code __________________________________________ (A)ppend Records, (S)how Records, (E)xit Step 3: Create a New Project Create a new project and name it LAB7. Write your code using the processing logic in Step 2. Make sure you save your program. Step 4: Compile and Execute a) Compile your program. Eliminate all the syntax errors. b) Build your program and verify the results of the program. Make corrections to the program logic, if necessary, until the results of the program execution are what you expect. Step 5: Print Screenshots and Program Capture a screen print of your output. (Do a print screen and paste into an MS Word document.) Copy your code and paste it into the same MS Word document that contains the screen print of your output. Save the Word document as Lab07_LastName_FirstInitial. END OF LAB