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

![#include <iostream>
#include <fstream>
3
// Define global constants for the maximum number of clients and pets here
4 const int MAX NUM - 28;
3 const int KMAXPETS - 7;
6 const std::string Filename="SampleRund.txt";
7
8 // Define the struct for Pet here
9- struct Pet
10
11
12
13
14
15 };
COLORE岛同志网险应限内需易联网高安国际限内S
10
18
17 // define the struct for Client here
19
27
20 std::string name;
std::string address;
21
22 float account balance;
23 int number of pets;
24
23 };
28 // Function Prototypes
40
29 vold GetAllClients(Client clients[], int & count, int & next_client_id);
38 vold PrintAllClients(const client clients[], int count);
31 vold SaveDatabase(const Client clients[], int count, int next_client_id];
32
57
58
39
33 Client ReadOneClient(std::lfstream 5);
34 int FindACLlent (const client clients[], int count, int client_id);
33 vold PrintB111(const Client clients[], int count, int client_td);
30
S5223885882EFRRRRRRS2328.82R====2258
37 vold FindAndPrintPetInfo(const Client clients[], int count, int client_id);
38 vold AddNewClient(const Client clients[], int count, int next_client_id];
39 vold DeleteClient(const Client clients[], int &count, int client_id];
62
std::string spectes;
std::string breed;
std::string name;
43 int main() {
03-
67
char gender;
trì 107;
09
struct Client
70
int client_id;
int *pet_list = new int[KMAXPETS];
73
74
80
}
68- else if(choice=2){
int client_id;
FindAndPrintPetInfo(clients, count, client_id);
84
86
Client clients[MAX_NUM];
int count = 0;
87
int client_id = 0;
int next_client_id = 8;
std::ifstream Infile;
71 }
infile.open(Filename);
72- else if(choice=3){
GetAllClients(clients, count, next_client_id];
AddNewClient clients, count, next_client_id);
75- else if(choice 4)
DeleteClient clients, count, client_id];
int choice;
do {
std::cout<<"1. Print out a bill for the client <std::endl;
std::cout<<"2. Print out the information on a pet for a client <std::endl;
std::cout<<"3. Add a client" << std::endl;
std::cout<<"4. Delete a client
std::endl;
std::cout<<"3.
Print the entire database clients" << std::endl;
std::cout<<"6. Quit and write out (update) the database << std::endl;
std::cin>> choice;
std::ctn.ignare();
if (choice - 1
PrintBlll(clients, count, client_id);
76
77 }
78- else if(choice-3)
79
}
81 } while (choice 1-6);
PrintAllClients(cllents, count);
std::ofstream outfile;
outfile.open(Filename);
SaveDatabase/clients, count, next_client_id);
autfile.close();
88}
89
90- /* Function GetAllClients: read the count, next_client_id, and client information from the file "client_database.dat" and stores them in the array clients[]
92 Inputs:
91
93 clients[] an array of Client structs
count -- a reference to an integer count
next_client_id -- a reference to the integer for the next client id number
97 - vold GetAllClients(Client clients[], int & count, int & nextcllent_id}{
98 std::ifstream Infile (Filename);](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3eb03a80-7cae-4d33-b228-e2e0361c370e%2F04eeafa6-3185-44a6-a962-c4697d2ee923%2F5n8k7j3_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images









