Copy Assignment 1 to Assignment 2. Relabel this assignment to be Assignment 2. If there were comments made regarding the grading of Assignment 1, apply those changes to assignment 2. 1. Modify this...


Copy Assignment 1 to Assignment 2. Relabel this assignment to be Assignment 2. If there were comments made regarding the grading of Assignment 1, apply those changes to assignment 2.<br>1. Modify this program to open the file

Extracted text: Copy Assignment 1 to Assignment 2. Relabel this assignment to be Assignment 2. If there were comments made regarding the grading of Assignment 1, apply those changes to assignment 2. 1. Modify this program to open the file "Customers.dat" so that all data can be read, and data written or appended to this file. 2. Add an option 2 and 3 to the menu so that the menu appears as below:Menu options '2' and '3' should now be considered a valid choice. 1. 1. Add Data 2. Update Data 3. Display all data X. Exit Program 3. Create a method called "getLargestCustomerNumber" and call it after the "Customers.dat" file has been opened. Read all the existing customerNumbers and determine the largest customerNumber. Use this number as the base when adding new customer data. 4. The program should be able to start multiple times and add data with increasing customerNumbers. There should be no duplicated customer numbers. 5. Menu Option 2 should do the following tasks a. Prompt for a customer number to change. b. Enter the address information ( Street 1 & 2, City, State and Zipcode) c. Find the record for the customer number and replace the address information. 6. Menu Option 3 should do the following tasks a. Reset the file pointer to the beginning of the file. b. For each record in the file, display the customer number, customer name and all address information. The items isDeleted and newLine are not to be displayed.
This program will store structure data in a file called Customers.dat.<br>For this assignment, create a menu with the following tasks:<br>1. Add Data<br>X. Exit Program<br>This menu needs to display

Extracted text: This program will store structure data in a file called Customers.dat. For this assignment, create a menu with the following tasks: 1. Add Data X. Exit Program This menu needs to display "Invalid choice" if '1' or 'X' is not the given choice. The menu should redisplay options until item 'X' is selected. Prior to this menu loop, the program needs to create the Customers.dat file if it does not exist The file "Customers.dat" must be opened in Binary mode. The file is opened for processing prior to the menu. This program may be written to automatically reset an existing Customers.dat file if it already exists. For option '1', prompt to enter the highlighted data items in the structure below. This is every item except customerNumber , isDeleted and newLine: const int NAME SIZE = 20: const int STREET_SIZE = 30; const int CITY_SIZE = 203; const int STATE_CODE_SIZE = 3; struct Customers { long customerNumber; char name[NAME_SIZE]; char streetAddress_1[STREET_SIZE]; char streetAddress_2[STREET_SIZE]; char city[CITY_SIZE]; char state[STATE_CODE_SIZE]; int zipcode; char isDeleted; char newline; }; Always set the item isDeleted to 'N' and newline to '\n'. The item newline is a convenient item that is there to assist in viewing the contents of the file using "type filename" in the cmd window. The item customerNumber should start at 0 and increase by 1 for every record written. This data item is not viewable in the file via notepad because it is stored in a binary format. Notepad will show the binary chars and will not line up the data as expected. You may see some odd characters after the expected data for the character arrays. That is normal for C/C++. Once the data in the structure is loaded, append the structure to the file "Customers.dat" and return to the menu. For option 'X': Close the data file display "Done!" Let the program terminate. Deliverable is a working CPP program.
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here