// Trying to design a flexible database system. // The stuff to do with animals works fine (on its own) // but C++ is so strict about types that it will not work // on humans even though humans have weights and print // methods. It isn't even close to working on numbers. #include #include struct animal { string name, species; int weight, price; animal(string n, string s, int w, int p) { name=n; species=s; weight=w; price=p; } void print() { cout << " " << name << "/" << species << ":" << weight << "g," << price << "c\n"; } }; struct human { string name; int weight, phone; human(string n, int w, int p) { name=n; weight=w; phone=p; } void print() { cout << " " << name << ", " << weight << " lbs, " << phone << "\n"; } }; void printall(animal * * data, int N) { for (int i=0; iprint(); } animal * reprice(animal * a) { a->price = (int)(a->price*1.1 + 0.5); return a; } animal * fatten(animal * a) { a->weight = (int)(a->weight*1.2 + 0.5); return a; } void map(animal * f(animal *), animal * * data, int N) { for (int i=0; i