can't fit this whole code, but I need help in making the functions DeleteClient, PrintAllClients, ReadOneClient, FindAClient, FindAndPrintPetInfo Instructions: In this C++ program, you are to implement a program that will manage a "database" of clients for a Pet Stylist. However, this is the stylist's side job, so the maximum number of clients will be fixed at 20 and each client can have at most 7 pets. The "database" is just a text file named client_database.dat. A sample database file has been included in your files. The program should first ask what the user wants to do from the following menu: Print out a bill for the client Print out the information on a pet for a client Add a client Delete a client Print the entire database of clients Quit and write out (update) the "database" The program should continue to ask what the user wants to do until the user selects option 6 (enters the number 6). Reminder: The maximum number of clients is 20 The maximum number of pets for a client is 7 Program Requirements: Use global constants to store the maximum client and pet array sizes There should be 2 struct's declared in your program: Pet and Client Pet -- contains the following data members strings for species, breed, and name of the pet a character for gender of the pet an integer for age of the pet Client -- contains the following data members an integer for the client_id -- the client's id/account number a string for name of the client and a string for the address of the client a floating point for account_balance that will contain the account balance for the client an integer number_of_pets for how many pets the client has Pet pet_list[kMaxPets] -- an array of Pet struct's to hold the pet information for each pet of the client implement the following functions, descriptions for what each function does are available in your main.cpp file as comments. void GetAllClients(Client clients[], int & count, int & next_client_id); Client ReadOneClient(std::ifstream &); int FindAClient(const Client clients[], int count, int client_id); void PrintBill(const Client clients[], int client_id, int count); void FindAndPrintPetInfo(const Client clients[], int client_id, int count); void AddNewClient(Client clients[], int & count, int & next_client_id); void DeleteClient(Client clients[], int client_id, int &count); void PrintAllClients(const Client clients[], int count); void SaveDatabase(const Client clients[],int count, int next_client_id);
I can't fit this whole code, but I need help in making the functions DeleteClient, PrintAllClients, ReadOneClient, FindAClient, FindAndPrintPetInfo
Instructions:
In this C++ program, you are to implement a program that will manage a "
The program should first ask what the user wants to do from the following menu:
- Print out a bill for the client
- Print out the information on a pet for a client
- Add a client
- Delete a client
- Print the entire database of clients
- Quit and write out (update) the "database"
The program should continue to ask what the user wants to do until the user selects option 6 (enters the number 6).
Reminder:
- The maximum number of clients is 20
- The maximum number of pets for a client is 7
Program Requirements:
-
Use global constants to store the maximum client and pet array sizes
-
There should be 2 struct's declared in your program: Pet and Client
- Pet -- contains the following data members
- strings for species, breed, and name of the pet
- a character for gender of the pet
- an integer for age of the pet
- Client -- contains the following data members
- an integer for the client_id -- the client's id/account number
- a string for name of the client and a string for the address of the client
- a floating point for account_balance that will contain the account balance for the client
- an integer number_of_pets for how many pets the client has
- Pet pet_list[kMaxPets] -- an array of Pet struct's to hold the pet information for each pet of the client
- Pet -- contains the following data members
-
implement the following functions, descriptions for what each function does are available in your main.cpp file as comments.
-
- void GetAllClients(Client clients[], int & count, int & next_client_id);
- Client ReadOneClient(std::ifstream &);
- int FindAClient(const Client clients[], int count, int client_id);
- void PrintBill(const Client clients[], int client_id, int count);
- void FindAndPrintPetInfo(const Client clients[], int client_id, int count);
- void AddNewClient(Client clients[], int & count, int & next_client_id);
- void DeleteClient(Client clients[], int client_id, int &count);
- void PrintAllClients(const Client clients[], int count);
- void SaveDatabase(const Client clients[],int count, int next_client_id);
- GetAllClients() should open the database, read from it, and close the file. It will repeatedly use ReadOneClient() to read one client's information from the database to store.
- SaveDatabase() should re-open the file to replace the old information by writing all current information, and closing the file.
- FindAClient() performs a simple linear search to try to find the client in the array
- No pointers
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images