Created
May 2, 2024 14:40
-
-
Save CodingDino/6e7003ef9111bcf96f1bbae6facf49cf to your computer and use it in GitHub Desktop.
Example of access modifiers used for Dog class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string> | |
using namespace std; | |
class Dog | |
{ | |
public: | |
string name; | |
int chipNumber; | |
float age; | |
private: | |
string breed; | |
string color; | |
string coatType; | |
public: | |
Dog(); | |
Dog(string newName, string newBreed, | |
string newColor, string newCoatType); | |
Dog(Dog& other); | |
~Dog(); | |
void Print(); | |
void Shed(); | |
void InstallChip(int newChip); | |
float Age(float amount); | |
private: | |
void Bark(); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment