Question
Write a classcalled Dog which keeps track of the dog's name, breed, age, andlicense fee. The license fee will be a set amount: $12.25, sinceyou only need one copy of this in memory, make it static. Include amethod which allows you to set the dog's name, breed and age.Include another method which displays the dog's name, breed, ageand license fee. I have no real idea how to do thisproblem, structure or anything really, any help? This is what I have so far #include <iostream> using namespace std; class Dog { }; int main() { } Write a classcalled Dog which keeps track of the dog's name, breed, age, andlicense fee. The license fee will be a set amount: $12.25, sinceyou only need one copy of this in memory, make it static. Include amethod which allows you to set the dog's name, breed and age.Include another method which displays the dog's name, breed, ageand license fee. I have no real idea how to do thisproblem, structure or anything really, any help? I have no real idea how to do thisproblem, structure or anything really, any help? This is what I have so far #include <iostream> using namespace std; class Dog { }; int main() { }
Explanation / Answer
please rate - thanks #include using namespace std; class Dog{ private: string name; string breed; int age; double fee; public: Dog() {name=""; breed=""; age=0; fee=0; } void set_info(stringn,string b,int a,double f) {name=n; breed=b; age=a; fee=f; } voidget_info(string& n,string& b,int& a, double& f) {f=fee; a=age; b=breed; n=name; } }; int main() {string n,b; int a; static double fee=12.25; double f; Dog fido; fido.set_info("Duke","German Shepard",5,fee); fido.get_info(n,b,a,f); cout