I need help with this assignment here. The code below is all i have so far and I'm stuck.
For this assignment you will write a class called Dog that has the following member variables:
birthyear. An int that holds the dog’s birth year.
breed. A string that holds the breed of dog.
vaccines. A Boolean holding a yes/no value indicating whether the dog is currently on vaccinations.
In addition, the class should have the following member functions:
Constructor. The constructor should accept the dog’s birthyear, breed and vaccines as arguments and assign these values to the object’s birthyear, breed and vaccines member variables.
Accessors. Appropriate accessor functions should be created to allow values to be retrieved from an object’s birthyear, breed and vaccines member variables.
Demonstrate the class in a program that creates a Dog object. The user should enter all input. Be sure to include comments throughout your code where appropriate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <iostream>
#include <string>
#include <time.h>
#include <iomanip>
using namespace std;
class Dog {
private:
int birth_year;
string breed;
bool vaccines;
public:
Dog()
}
};
int main() {
Dog myobj;
cout << "Enter Birth Year" << endl;
cin >> myobj.birth_year;
}
|