Question: #include pch.h #include #include using namespace std; const int NAME_SIZE = 20, STREET_SIZE = 30, CITY_SIZE = 20, STATE_CODE_SIZE = 3; struct Customers { long

#include "pch.h"

#include

#include

using namespace std;

const int NAME_SIZE = 20, STREET_SIZE = 30, CITY_SIZE = 20, 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;

};

int main()

{

Customers information;

char again;

fstream customer("customer.dat", ios::out | ios::binary);

do

{

long cus_num = 0;

cout << "Enter the following information about a customer: ";

cout << "Name: ";

cin.getline(information.name, NAME_SIZE);

cout << "Address line 1: ";

cin.getline(information.streetAddress_1, STREET_SIZE);

cout << "Address line 2: ";

cin.getline(information.streetAddress_2, STREET_SIZE);

cout << "City: ";

cin.getline(information.city, CITY_SIZE);

cout << "State: ";

cin.getline(information.state, STATE_CODE_SIZE);

cout << "Zip Code: ";

cin >> information.zipcode;

cin.ignore();

customer.write(reinterpret_cast(&information), sizeof(information));

cout << "Do you want to enter another record? ";

cin >> again;

cin.ignore();

} while (again == 'Y' || again == 'y');

cus_num++;

information.customerNumber = cus_num;

customer << information.customerNumber << "";

customer.close();

return 0;

}

I need to creat a getLargestCusomerNumber method

display customer number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!