#include <iostream>
using namespace std;
class Dog
{
private:
const double licenseFee = 13.45;
string name;
string breed;
int age;
public:
void setName(string name)
{
this->name = name;
}
void displayName()
{
cout << name;
}
void setBreed(string breed)
{
this->breed = breed;
}
void displayBreed()
{
cout << breed;
}
void setAge(int age)
{
this->age = age;
}
void displayAge()
{
cout << age;
}
};
int main()
{
string name;
cout << "Enter name: ";
getline(cin, name);
string breed;
cout << "Enter breed: ";
getline(cin, breed);
int age;
cout << "Enter age: ";
cin >> age;
Dog dog;
dog.setName(name);
dog.setBreed(breed);
dog.setAge(age);
cout << endl << "Name: ";
dog.displayName();
cout << endl << "Breed: ";
dog.displayBreed();
cout << endl << "Age: ";
dog.displayAge();
return 0;
}
Comments
Leave a comment