SlideShare ist ein Scribd-Unternehmen logo
1 von 8
DEVRY CIS 170 C iLab 7 of 7 Sequential Files
Check this A+ tutorial guideline at
http://www.cis170entirecourse.com/cis-170/cis-
170-c-ilab-7-of-7-sequential-files
For more classes visit
http://www.cis170entirecourse.com
www.cisl70entirecourse.com
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.
10 icon and launch
U.'Locate the Visual
Stu 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);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
string * split(string,
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
^“ng *(lineBuffer, ',');
//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
e
^s
the/
arth
ydellmlna
‘or hit
”
theFieldArray[commaCount] = theField; //save
the field to the array
:o the field
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)
mewrite name, city, etc. to
the Vv^vWit **111
end loop
close the file
End
The program input should appear similar to
this. Append Records
Name..........John Smith
Street.........902 Union Ave
City............Any Town
State...........TX
Zip Code......78552
"Enter another Record? (Y/N) "
The file structure should look like this.
John Smith, 902 Union Ave, Any Town, TX,
79552 Eric Jones, 345 State Way, Fresno, CA,
93432 ■ ■ ■
The file output should appear similar to the
following.
Show Records
Record #1
Name...........John Smith
Street..........902 Union Ave
City.............Any Town
State...........TX
Z,
p Code
......78552
_
Record #2
Name...........Eric Jones
Street..........345 State Way
City.............Fresno
State...........CA
Zip Code.......93432
(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 pri
your output. Save the Word document
as Lab07 LastName FirstInitial.
i„, of
END OF LAB

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Files in c++
Files in c++Files in c++
Files in c++
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
 
Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01Filesinc 130512002619-phpapp01
Filesinc 130512002619-phpapp01
 
PHP 5.3
PHP 5.3PHP 5.3
PHP 5.3
 
Linker scripts
Linker scriptsLinker scripts
Linker scripts
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
6. chapter v
6. chapter v6. chapter v
6. chapter v
 
Filehadnling
FilehadnlingFilehadnling
Filehadnling
 
Filesin c++
Filesin c++Filesin c++
Filesin c++
 
Unix
UnixUnix
Unix
 
Operating system
Operating systemOperating system
Operating system
 
Fileinc
FileincFileinc
Fileinc
 
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
 
Python - File operations & Data parsing
Python - File operations & Data parsingPython - File operations & Data parsing
Python - File operations & Data parsing
 
Mysql
MysqlMysql
Mysql
 
Libraries
LibrariesLibraries
Libraries
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
2006 Esug Omnibrowser
2006 Esug Omnibrowser2006 Esug Omnibrowser
2006 Esug Omnibrowser
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 

Ähnlich wie Devry cis-170-c-i lab-7-of-7-sequential-files

Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCIS321
 
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docxStudent Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docxflorriezhamphrey3065
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System iChuck Walker
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++Shyam Gupta
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code LabColin Su
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with filesramya marichamy
 
Managing,working with files
Managing,working with filesManaging,working with files
Managing,working with fileskirupasuchi1996
 
C_and_C++_notes.pdf
C_and_C++_notes.pdfC_and_C++_notes.pdf
C_and_C++_notes.pdfTigabu Yaya
 
Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)Abdullah khawar
 
file handling final3333.pptx
file handling final3333.pptxfile handling final3333.pptx
file handling final3333.pptxradhushri
 
Final opensource record 2019
Final opensource record 2019Final opensource record 2019
Final opensource record 2019Karthik Sekhar
 

Ähnlich wie Devry cis-170-c-i lab-7-of-7-sequential-files (20)

Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential files
 
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docxStudent Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
 
17 files and streams
17 files and streams17 files and streams
17 files and streams
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code Lab
 
Linux com
Linux comLinux com
Linux com
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Managing console i/o operation,working with files
Managing console i/o operation,working with filesManaging console i/o operation,working with files
Managing console i/o operation,working with files
 
Managing,working with files
Managing,working with filesManaging,working with files
Managing,working with files
 
C_and_C++_notes.pdf
C_and_C++_notes.pdfC_and_C++_notes.pdf
C_and_C++_notes.pdf
 
Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)Pf cs102 programming-8 [file handling] (1)
Pf cs102 programming-8 [file handling] (1)
 
file handling final3333.pptx
file handling final3333.pptxfile handling final3333.pptx
file handling final3333.pptx
 
Final opensource record 2019
Final opensource record 2019Final opensource record 2019
Final opensource record 2019
 

Mehr von noahjamessss

Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menunoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsnoahjamessss
 
Devry cis-170-c-i lab-3-of-7-looping
Devry cis-170-c-i lab-3-of-7-loopingDevry cis-170-c-i lab-3-of-7-looping
Devry cis-170-c-i lab-3-of-7-loopingnoahjamessss
 
Devry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsDevry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsnoahjamessss
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startednoahjamessss
 
Devry busn-278-entire-course
Devry busn-278-entire-courseDevry busn-278-entire-course
Devry busn-278-entire-coursenoahjamessss
 
Busn 278-week-4-midterm
Busn 278-week-4-midtermBusn 278-week-4-midterm
Busn 278-week-4-midtermnoahjamessss
 
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupBus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupnoahjamessss
 
Ash bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingAsh bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingnoahjamessss
 
Ash bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsAsh bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsnoahjamessss
 
Ash bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentAsh bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentnoahjamessss
 
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewAsh bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewnoahjamessss
 
Ash bus-650-ash-complete-class
Ash bus-650-ash-complete-classAsh bus-650-ash-complete-class
Ash bus-650-ash-complete-classnoahjamessss
 
Keller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project dueKeller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project duenoahjamessss
 
Hrm 326 final exam guide
Hrm 326 final exam guideHrm 326 final exam guide
Hrm 326 final exam guidenoahjamessss
 
Mkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newMkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newnoahjamessss
 
Uop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newUop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newnoahjamessss
 
Uop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newUop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newnoahjamessss
 
Uop str 581 week 4
Uop str 581 week 4Uop str 581 week 4
Uop str 581 week 4noahjamessss
 

Mehr von noahjamessss (20)

Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Devry cis-170-c-i lab-3-of-7-looping
Devry cis-170-c-i lab-3-of-7-loopingDevry cis-170-c-i lab-3-of-7-looping
Devry cis-170-c-i lab-3-of-7-looping
 
Devry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsDevry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisions
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
 
Devry busn-278-entire-course
Devry busn-278-entire-courseDevry busn-278-entire-course
Devry busn-278-entire-course
 
Busn 278-week-4-midterm
Busn 278-week-4-midtermBusn 278-week-4-midterm
Busn 278-week-4-midterm
 
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupBus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
 
Ash bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingAsh bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-funding
 
Ash bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsAsh bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earnings
 
Ash bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentAsh bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investment
 
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewAsh bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
 
Ash bus-650-ash-complete-class
Ash bus-650-ash-complete-classAsh bus-650-ash-complete-class
Ash bus-650-ash-complete-class
 
Keller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project dueKeller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project due
 
Hrm 326 final exam guide
Hrm 326 final exam guideHrm 326 final exam guide
Hrm 326 final exam guide
 
Mkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newMkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) new
 
Uop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newUop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 new
 
Uop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newUop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 new
 
Uop str 581 week 4
Uop str 581 week 4Uop str 581 week 4
Uop str 581 week 4
 

Kürzlich hochgeladen

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 

Kürzlich hochgeladen (20)

latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 

Devry cis-170-c-i lab-7-of-7-sequential-files

  • 1. DEVRY CIS 170 C iLab 7 of 7 Sequential Files Check this A+ tutorial guideline at http://www.cis170entirecourse.com/cis-170/cis- 170-c-ilab-7-of-7-sequential-files For more classes visit http://www.cis170entirecourse.com www.cisl70entirecourse.com 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
  • 2. 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. 10 icon and launch U.'Locate the Visual Stu 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
  • 3. 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);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 string * split(string,
  • 4. 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 ^“ng *(lineBuffer, ','); //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
  • 5. //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 e ^s the/ arth ydellmlna ‘or hit ” theFieldArray[commaCount] = theField; //save the field to the array :o the field commaCount++; } } theFieldArray[commaCount] = theField; //the last field is not marked with a comma- return theFieldArray; } //end split Step 2: Processing Logic
  • 6. 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) mewrite name, city, etc. to the Vv^vWit **111 end loop close the file End The program input should appear similar to this. Append Records Name..........John Smith Street.........902 Union Ave City............Any Town State...........TX Zip Code......78552 "Enter another Record? (Y/N) "
  • 7. The file structure should look like this. John Smith, 902 Union Ave, Any Town, TX, 79552 Eric Jones, 345 State Way, Fresno, CA, 93432 ■ ■ ■ The file output should appear similar to the following. Show Records Record #1 Name...........John Smith Street..........902 Union Ave City.............Any Town State...........TX Z, p Code ......78552 _ Record #2 Name...........Eric Jones Street..........345 State Way City.............Fresno State...........CA Zip Code.......93432 (A)ppend Records, (S)how Records, (E)xit Step 3: Create a New Project
  • 8. 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 pri your output. Save the Word document as Lab07 LastName FirstInitial. i„, of END OF LAB