#include "stdstuff.h" #include "Date.h" // "customer" is the struct containing the customer information // it is made up of id (an integer) and total (a double) struct customer{ int id; double total; Date purchDate; String2002 custName; }; const int MAXCUST=100; // Hint: make MAXCUSTS much smaller to test filling the database // customerDB is the customer database struct struct customerDB{ customer ci[MAXCUST]; // the array of customer information int numCusts; // the number of customers currently in the database }; // add a new customer to the database; returns true if successful, false otherwise // (database full or customer already exists) bool addCustomer(int id, double total, const Date &purchase, const String2002 &name, customerDB &db); // remove a customer from the database; returns true if successful, false otherwise (customer // does not exist) bool removeCustomer(int id, customerDB &db); // prints the full customer database (or a note if the database is empty) // Customers are printed one per two lines, with 2 decimals for the total, // and purchase date and name on the second line. void printCustomerDatabase(const customerDB &db); // change the customer number of an existing customer; returns true if successful, // false otherwise (customer does not exist, or new customer id in use) bool changeCustomerID(int id, int nid, customerDB &db); // change the customer total of an existing customer; returns true if successful, // false otherwise (customer does not exist) bool changeCustomerTotal(int id, double ntotal, customerDB &db); // move the purchase date by the number of days given; returns true if successful, // false otherwise (customer does not exist) bool moveCustomerDate(int id, int days, customerDB &db); // append the given String2002 to the customer name; returns true if successful, // false otherwise (customer does not exist) bool appendCustomerName(int id, const String2002 &add, customerDB &db); // returns the highest total of all customers // (returns -1 if there are no customers in the database) double getBestCustomerTotal(const customerDB &db); // prints (to cout) the earliest purchase date of all customers // (prints 1 1 1900 if there are no customers in the database) void outputFirstCustomerDate(const customerDB &db); // returns the customer name that's first in case insensitive alphabetical order // (returns "" if there are no customers in the database) String2002 getFirstCustomerName(const customerDB &db);