#include "stdstuff.h" #include "Date.h" class CustomerDB { private: // "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; }; enum {MAXCUST=100}; // another way of declaring an int const // Hint: make MAXCUST much smaller to test filling the database // the old fields of the customerDB struct are now fields in our class customer ci[MAXCUST]; // the array of customer information int numCusts; // the number of customers currently in the database public: // Your methods go here. Remember to describe each method (i.e. comments!) // and use "const" where appropriate. // the constructor creates an empty database CustomerDB(); // returns the number of customers in the database int getNumCusts() const; // add a new customer to the database; returns true if successful, false otherwise // (database full or customer already exists) bool add(int id, double total, const Date &purchase, const String2002 &name); // remove a customer from the database; returns true if successful, false otherwise (customer // does not exist) bool remove(int id); // 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 the purchase date and name on the second line. void print() const; // 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 changeID(int id, int nid); // change the customer total of an existing customer; returns true if successful, // false otherwise (customer does not exist) bool changeTotal(int id, double ntotal); // move the purchase date by the number of days given; returns true if successful, // false otherwise (customer does not exist) bool moveDate(int id, int days); // append the given String2002 to the customer name; returns true if successful, // false otherwise (customer does not exist) bool appendName(int id, const String2002 &add); // returns the highest total of all customers // (returns -1 if there are no customers in the database) double getBestTotal() const; // prints (to cout) the earliest purchase date of all customers // (prints 1 1 1900 if there are no customers in the database) void outputFirstDate() const; // returns the customer name that's first in case insensitive alphabetical order // (returns "" if there are no customers in the database) String2002 getFirstName() const; };