Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Once the data in the structure is loaded. append the structure to the le Customersdat and return to the menu. For option 'X': Close the

image text in transcribedimage text in transcribedimage text in transcribed
Once the data in the structure is loaded. append the structure to the le "Customersdat" and return to the menu. For option 'X': Close the data file display "Done!" Let the program terminate. Deliverable is a working CPP program. 08:Assignment 2 Due Wednesday by 11:59pm Points 10 Submitting a text entry box or a le upload Review Section 12.8 This program will store structure data in a le 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 = 20; const int STATE_CODE_SIZE = 3; struct Customers 1 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 '\ '. The item newLine is a convenient item that is there to assist in viewing th e 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++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions