Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Accounting Basics Expert

Student Lab Activity
A. Lab # CIS CIS170C-A7
B. Lab 7 of 7: Sequential Files
C. 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 report

D. Deliverables

Section
Deliverable
Points
Step
Program Listing and Output

45
E. 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 *theFields = split(lineBuffer, ',');

//determine how many splits there will be so we can size our array
int splitCount = 0;
for(int i = 0; i < theLine.size(); 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;
theFieldArray = new string[splitCount];
//split the string into seperate fields
string theField = "";
int commaCount = 0;

for(int i = 0; i < theLine.size(); i++){ //read each character and look for the deliminator
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
theField = "";
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.........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
Zip 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

1. Capture a screen print of your output. (Do a print screen and paste into an MS Word document.)
2. Copy your code and paste it into the same MS Word document that contains the screen print of your output.
3. Save the Word document as Lab07_LastName_FirstInitial.

Accounting Basics, Accounting

  • Category:- Accounting Basics
  • Reference No.:- M91589543
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Accounting Basics

Question - jimeniz enterprises issued 9 5-year 2600000 par

Question - Jimeniz Enterprises issued 9%, 5-year, $2,600,000 par value bonds that pay interest semiannually on September 1 and March 1. The bonds are dated September 1, 2014, and are issued on that date. The market rate ...

Question - if colleen mooney invests 476550 now and she

Question - If Colleen Mooney invests $4,765.50 now and she will receive $12,000 at the end of 12 years, what annual rate of interest will Colleen earn on her investment? Compute the number of periods of a single amount. ...

Question - make a statement of comprehensive income from

Question - Make a statement of comprehensive income from the following data? Sales revenue $40,000,000 General and administrative expenses 8,200,000 Deferred revenue 100,000 Interest expense 65,000 Selling expenses 1,800 ...

Question the availability of funds effects the capital

Question: The availability of funds effects the capital budgeting decisions. The amount of funds available for capital expenditures will be either limited or unlimited. Funds would be considered unlimited when a firm is ...

Question - the records of riverbeds boutique report the

Question - The records of Riverbed's Boutique report the following data for the month of April. Sales revenue$100,100 Purchases (at cost) $47,400 Sales returns 1,900 Purchases (at sales price) 95,300 Markups 9,500 Purcha ...

Question - flounder corporation sold 3490000 7 5-year bonds

Question - Flounder Corporation sold $3,490,000, 7%, 5-year bonds on January 1, 2017. The bonds were dated January 1, 2017, and pay interest on January 1. Flounder Corporation uses the straight-line method to amortize bo ...

Question - assume a legal entitys capital structure

Question - Assume a Legal Entity's capital structure consists of the following accounts: Short-term note payable $ 200,000 Long-term note payable 500,000 Mandatorily redeemable preferred stock 350,000 Common stock 60,000 ...

Question - the calculated variable cost per unit of 18high

Question - The calculated variable cost per unit of $1.8 High Level of activity is: 1,691 units and $7,147cost. If the low level of activity was 530 units, calculate the fixed cost at the low level of activity?

Question - the adjusted trial balance of cheyenne company

Question - The adjusted trial balance of Cheyenne Company shows the following data pertaining to sales at the end of its fiscal year, October 31, 2017: Sales Revenue $752,300, Delivery Expense $13,020, Sales Returns and ...

Question paper 01 ubs tax evasion paperprepare 500-750-word

Question: Paper 01: UBS Tax Evasion Paper Prepare 500-750-word paper in which you address the following: • Discuss the matter of 2008 UBS Tax Evasion charges. • Explain your understanding of their cause, the impact on th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As