i need some help with the following program.. i think i have the basics but do not understand the more "complicated things"
#include <iostream>
#include <string>
using namespace std;
class pets
{
protected:
string type;
double price;
public:
void get_type(void);
void show_type(void);
void get_price(void);
void show_price(void);
};
void pets::get_type(void)
{
cout <<"Enter the type of pet. "; cin >> type;
}
void pets::show_type(void)
{
cout <<"The type of pet is "<< type << endl;
}
void pets::get_price(void)
{
cout <<"Enter the price of your pet. ";cin >>price;
}
void pets::show_price(void)
{
cout << "The price of your pet is " << price<<endl;
}
void main(void)
{
pets my_pet;
my_pet.get_type();
my_pet.show_type();
my_pet.get_price();
my_pet.show_price();
}
now i think that is right... i now need a class called dog and a class called cat... and need them to do the PARENT class's functions... though im not sure how to go about that... if anyone can provide some help that would be appreciated