Week 7: Lab - Computer Science
Attached Student Lab Activity CIS170 Week 7 Lab Instructions Lab 7 of 7: Sequential Files Lab Overview—Scenario/Summary You will code, build, and execute a program that creates an address database using a sequential text file in Comma Separated Value (CSV) format. Learning Outcomes 1. Continue using a menu system with a console application. 2. Read and write a sequential text file. 3. Generate output records in CSV format. 4. Parse CSV formatted input records and display the results. Deliverables Section Deliverable Points Lab Program Listing and Output · Accepts names and addresses from console · Writes addresses to text file · Reads and displays addresses from file · Provides menu options for entry, display, and exit · Code is provided in lab report · Screen shots of working program provided in lab report · Code is appropriately commented, formatted, and readable 5 5 5 5 5 5 10 All Steps Total 40 Lab Steps Preparation: If you are using the Citrix remote lab, follow the login instructions located in the lab area in Course Home. Locate the Visual Studio icon and launch the application. Lab: Step 1: Revjew the Requirements for an Address Record Application Review and analyze the following requirements for a C++ console application that will store and retrieve names and addresses in a text file. The program should do the following. 1. Display a main menu providing the user with options to 1) Enter new address records; 2) Display address records; 3) Exit the program. 2. If the user selects 1) Enter new address records: a. Create a new text file named Address.csv b. Prompt the user to enter a name, street, city, state, and zip code. c. Write the entered data to the text file in Comma Separated Value (CSV) format. d. Ask if the user wants to enter another record. If so, repeat; if not, close the file and return to the main menu. 3. If the user selects 2) Display address records: a. Open the text file named Address.csv b. Read and display the name, street, city, state, and zip code from each record in the file in a readable format. c. Close the file and return to the main menu. 4. If the user selects 3) Exit: Exit the program. Step 2: Create project and enter skeleton code a. In Visual Studio, create a new C++ console application project named Lab7 using the empty project option. b. Create a new C++ source file in the project named Lab7.cpp. c. Enter or copy/paste in the following skeleton code, which you will build upon to complete the rest of the assignment: // --------------------------------------------------------------- // Programming Assignment: CIS170C Lab 7 // Developer: ______________________ // Date Written: // Purpose: Store and retrieve names and addresses in a // sequential text file in CSV format. // --------------------------------------------------------------- #include <iostream> #include <fstream> #include <string> using namespace std; // function prototypes void EnterAndWriteAddresses(void); //Accept address records from user, write to file void ReadAndDisplayAddresses(void); //Read address records from file, display const string ADDRESS_FILE_NAME = Address.csv; // file name for address data file // main program -- displays main menu and processes user selection void main() { cout << Address Record Application << endl << endl; //TODO: Add main menu loop here with options for // 1) Enter new address records // 2) Display address records // 3) Exit the program // Display error message if invalid choice is entered // Repeat loop while user has not entered 3 system(pause); } // Enter address records and write to address file void EnterAndWriteAddresses(void) { //TODO: Declare variables for name and address fields //TODO: Open address file for output using ofstream() //TODO: Loop to accept and write addresses // Prompt user to enter name and address fields // Write entered data to address file separated by commas // Ask user if more addresses to enter // Repeat loop while user responds Y or y //TODO: Close address file } // Read records from address file and display to user void ReadAndDisplayAddresses(void) { string name, street, city, state, zip; ifstream inputAddress(ADDRESS_FILE_NAME); // open address file for input if (inputAddress.is_open()) { //read and display all records from address file while (getline(inputAddress, name, ,)) { //read name field getline(inputAddress, street, ,); //read street field //TODO: Add getline statements to read remaining fields //NOTE: Delimiter for last field must be newline \n not comma //TODO: Add cout statements to display addresses to user } inputAddress.close(); //close address file } } d. Enter your name and the current date in the comment header. e. Compile and test the program. Fix any reported errors. The output at this point should look similar to the following: Step 3: Code and test main menu a. Inside the main() function, code a loop that will display a main menu with the required 3 options, accept the users choice, and repeat while the users choice is not option 3 (exit). NOTE: Remember to use cin.ignore() after you accept the users choice, to discard the trailing newline character that may be left in the keyboard buffer after input of a number or single character. b. Inside your main menu loop, code a switch structure that will process the users choice. For now, for each option simply code cout statements to display an appropriate message for each choice. c. Display an error message if the user made an invalid menu choice (anything other than 1, 2, or 3). d. Compile and test the program. Fix any reported errors. The output at this point should look similar to the following: Step 4: Code and test entering address data and writing to the address file a. In the switch statement in your main menu loop, replace the cout statement for option 1 with a call to the EnterAndWriteAddresses() function. b. In the EnterAndWriteAddresses() function, declare string variables to hold the name and address fields (name, street, city, state, and zip code). c. Open the address file for output, using the string constant ADDRESS_FILE_NAME as the file name and an appropriate file stream object. d. Code a loop in which you prompt the user to enter each of the name and address fields and accept the users input into the corresponding string variable. Use the getline() function as some fields may contain spaces. At the bottom of the loop, ask the user if they want to enter another record, and repeat the loop as long as they respond with an upper- or lower-case Y. e. Inside the data entry loop, after the user has entered a set of address data, write the name and address fields to the address file using the file stream object you created when you opened the file. Output a comma , between each field. At the end of the address record, output a newline using a \n or endl (do not put a comma after the last field in the record). f. At the end of the EnterAndWriteAddresses() function, close the address file. g. Compile and test the program. Fix any reported errors. The output at this point should look similar to the following: h. To check that your address data were written to the output file correctly, in Visual Studio, pull down the File menu and choose Open > File. Select the Address file and click Open. You should see something similar to the following: Check that the name and address fields were written correctly, that the fields within each record are separated by commas, and that each record appears on a separate line. If you see any problems in the output file, make adjustments in your code and test again. Step 5: Code and test reading and displaying data from the address file a. In the switch statement in your main menu loop, replace the cout statement for option 2 with a call to the ReadAndDisplayAddresses() function. b. In the ReadAndDisplayAddresses() function, following the getline() statement that reads the street field, add additional getline() statements to read each of the other fields into the appropriate string variable. These will be similar to the getline() for street, except for the variable name. However, in reading the last field (zip), change the comma , delimiter to a newline \n because the last field in the record is not followed by a comma. c. After reading in the fields from the address file, add cout statements to display the name and address to the user in a professional, readable format. d. Compile and test the program. Fix any reported errors. The output at this point should look similar to the following: Step 6: Capture and submit screen shots and code a. Do a final end-to-end test of your program in which you enter addresses (option 1) and display these addresses (option 2) in a single run. b. Capture a screen shot of your output and paste into an MS Word document. c. Copy your code and paste it into the same MS Word document. d. Save the Word document as Lab07_LastName_FirstInitial and submit it for the Lab 7 assignment. Version 1.0 Page 1 of 9 4/9/2009 Lab Activity CIS CIS170B-A1.docx Page 5 of 6 Lab Activity CIS CIS170C-A7
CATEGORIES
Economics Nursing Applied Sciences Psychology Science Management Computer Science Human Resource Management Accounting Information Systems English Anatomy Operations Management Sociology Literature Education Business & Finance Marketing Engineering Statistics Biology Political Science Reading History Financial markets Philosophy Mathematics Law Criminal Architecture and Design Government Social Science World history Chemistry Humanities Business Finance Writing Programming Telecommunications Engineering Geography Physics Spanish ach e. Embedded Entrepreneurship f. Three Social Entrepreneurship Models g. Social-Founder Identity h. Micros-enterprise Development Outcomes Subset 2. Indigenous Entrepreneurship Approaches (Outside of Canada) a. Indigenous Australian Entrepreneurs Exami Calculus (people influence of  others) processes that you perceived occurs in this specific Institution Select one of the forms of stratification highlighted (focus on inter the intersectionalities  of these three) to reflect and analyze the potential ways these ( American history Pharmacology Ancient history . Also Numerical analysis Environmental science Electrical Engineering Precalculus Physiology Civil Engineering Electronic Engineering ness Horizons Algebra Geology Physical chemistry nt When considering both O lassrooms Civil Probability ions Identify a specific consumer product that you or your family have used for quite some time. This might be a branded smartphone (if you have used several versions over the years) or the court to consider in its deliberations. Locard’s exchange principle argues that during the commission of a crime Chemical Engineering Ecology aragraphs (meaning 25 sentences or more). Your assignment may be more than 5 paragraphs but not less. INSTRUCTIONS:  To access the FNU Online Library for journals and articles you can go the FNU library link here:  https://www.fnu.edu/library/ In order to n that draws upon the theoretical reading to explain and contextualize the design choices. Be sure to directly quote or paraphrase the reading ce to the vaccine. Your campaign must educate and inform the audience on the benefits but also create for safe and open dialogue. A key metric of your campaign will be the direct increase in numbers.  Key outcomes: The approach that you take must be clear Mechanical Engineering Organic chemistry Geometry nment Topic You will need to pick one topic for your project (5 pts) Literature search You will need to perform a literature search for your topic Geophysics you been involved with a company doing a redesign of business processes Communication on Customer Relations. Discuss how two-way communication on social media channels impacts businesses both positively and negatively. Provide any personal examples from your experience od pressure and hypertension via a community-wide intervention that targets the problem across the lifespan (i.e. includes all ages). Develop a community-wide intervention to reduce elevated blood pressure and hypertension in the State of Alabama that in in body of the report Conclusions References (8 References Minimum) *** Words count = 2000 words. *** In-Text Citations and References using Harvard style. *** In Task section I’ve chose (Economic issues in overseas contracting)" Electromagnetism w or quality improvement; it was just all part of good nursing care.  The goal for quality improvement is to monitor patient outcomes using statistics for comparison to standards of care for different diseases e a 1 to 2 slide Microsoft PowerPoint presentation on the different models of case management.  Include speaker notes... .....Describe three different models of case management. visual representations of information. They can include numbers SSAY ame workbook for all 3 milestones. You do not need to download a new copy for Milestones 2 or 3. When you submit Milestone 3 pages): Provide a description of an existing intervention in Canada making the appropriate buying decisions in an ethical and professional manner. Topic: Purchasing and Technology You read about blockchain ledger technology. Now do some additional research out on the Internet and share your URL with the rest of the class be aware of which features their competitors are opting to include so the product development teams can design similar or enhanced features to attract more of the market. The more unique low (The Top Health Industry Trends to Watch in 2015) to assist you with this discussion.         https://youtu.be/fRym_jyuBc0 Next year the $2.8 trillion U.S. healthcare industry will   finally begin to look and feel more like the rest of the business wo evidence-based primary care curriculum. Throughout your nurse practitioner program Vignette Understanding Gender Fluidity Providing Inclusive Quality Care Affirming Clinical Encounters Conclusion References Nurse Practitioner Knowledge Mechanics and word limit is unit as a guide only. The assessment may be re-attempted on two further occasions (maximum three attempts in total). All assessments must be resubmitted 3 days within receiving your unsatisfactory grade. You must clearly indicate “Re-su Trigonometry Article writing Other 5. June 29 After the components sending to the manufacturing house 1. In 1972 the Furman v. Georgia case resulted in a decision that would put action into motion. Furman was originally sentenced to death because of a murder he committed in Georgia but the court debated whether or not this was a violation of his 8th amend One of the first conflicts that would need to be investigated would be whether the human service professional followed the responsibility to client ethical standard.  While developing a relationship with client it is important to clarify that if danger or Ethical behavior is a critical topic in the workplace because the impact of it can make or break a business No matter which type of health care organization With a direct sale During the pandemic Computers are being used to monitor the spread of outbreaks in different areas of the world and with this record 3. Furman v. Georgia is a U.S Supreme Court case that resolves around the Eighth Amendments ban on cruel and unsual punishment in death penalty cases. The Furman v. Georgia case was based on Furman being convicted of murder in Georgia. Furman was caught i One major ethical conflict that may arise in my investigation is the Responsibility to Client in both Standard 3 and Standard 4 of the Ethical Standards for Human Service Professionals (2015).  Making sure we do not disclose information without consent ev 4. Identify two examples of real world problems that you have observed in your personal Summary & Evaluation: Reference & 188. Academic Search Ultimate Ethics We can mention at least one example of how the violation of ethical standards can be prevented. Many organizations promote ethical self-regulation by creating moral codes to help direct their business activities *DDB is used for the first three years For example The inbound logistics for William Instrument refer to purchase components from various electronic firms. During the purchase process William need to consider the quality and price of the components. In this case 4. A U.S. Supreme Court case known as Furman v. Georgia (1972) is a landmark case that involved Eighth Amendment’s ban of unusual and cruel punishment in death penalty cases (Furman v. Georgia (1972) With covid coming into place In my opinion with Not necessarily all home buyers are the same! When you choose to work with we buy ugly houses Baltimore & nationwide USA The ability to view ourselves from an unbiased perspective allows us to critically assess our personal strengths and weaknesses. This is an important step in the process of finding the right resources for our personal learning style. Ego and pride can be · By Day 1 of this week While you must form your answers to the questions below from our assigned reading material CliftonLarsonAllen LLP (2013) 5 The family dynamic is awkward at first since the most outgoing and straight forward person in the family in Linda Urien The most important benefit of my statistical analysis would be the accuracy with which I interpret the data. The greatest obstacle From a similar but larger point of view 4 In order to get the entire family to come back for another session I would suggest coming in on a day the restaurant is not open When seeking to identify a patient’s health condition After viewing the you tube videos on prayer Your paper must be at least two pages in length (not counting the title and reference pages) The word assimilate is negative to me. I believe everyone should learn about a country that they are going to live in. It doesnt mean that they have to believe that everything in America is better than where they came from. It means that they care enough Data collection Single Subject Chris is a social worker in a geriatric case management program located in a midsize Northeastern town. She has an MSW and is part of a team of case managers that likes to continuously improve on its practice. The team is currently using an I would start off with Linda on repeating her options for the child and going over what she is feeling with each option.  I would want to find out what she is afraid of.  I would avoid asking her any “why” questions because I want her to be in the here an Summarize the advantages and disadvantages of using an Internet site as means of collecting data for psychological research (Comp 2.1) 25.0\% Summarization of the advantages and disadvantages of using an Internet site as means of collecting data for psych Identify the type of research used in a chosen study Compose a 1 Optics effect relationship becomes more difficult—as the researcher cannot enact total control of another person even in an experimental environment. Social workers serve clients in highly complex real-world environments. Clients often implement recommended inte I think knowing more about you will allow you to be able to choose the right resources Be 4 pages in length soft MB-920 dumps review and documentation and high-quality listing pdf MB-920 braindumps also recommended and approved by Microsoft experts. The practical test g One thing you will need to do in college is learn how to find and use references. References support your ideas. College-level work must be supported by research. You are expected to do that for this paper. You will research Elaborate on any potential confounds or ethical concerns while participating in the psychological study 20.0\% Elaboration on any potential confounds or ethical concerns while participating in the psychological study is missing. Elaboration on any potenti 3 The first thing I would do in the family’s first session is develop a genogram of the family to get an idea of all the individuals who play a major role in Linda’s life. After establishing where each member is in relation to the family A Health in All Policies approach Note: The requirements outlined below correspond to the grading criteria in the scoring guide. At a minimum Chen Read Connecting Communities and Complexity: A Case Study in Creating the Conditions for Transformational Change Read Reflections on Cultural Humility Read A Basic Guide to ABCD Community Organizing Use the bolded black section and sub-section titles below to organize your paper. For each section Losinski forwarded the article on a priority basis to Mary Scott Losinksi wanted details on use of the ED at CGH. He asked the administrative resident