Question: Create a program that will loop and prompt to enter the highlighted data items in the structure below. This is every item except customerNumber ,
Create a program that will loop and 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 { 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 the contents of the file in Notepad.exe.
The item customerNumber should start at 0 and increase by 1 for every record written.
Once the data in the structure is loaded, write it to the file "Customers.dat" and prompt to continue. If the reply is to not continue, close the file and exit.
The file "Customers.dat" must be opened in Binary mode.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
