Skip to content

Instantly share code, notes, and snippets.

@CodingDino
Created May 2, 2024 14:40
Show Gist options
  • Save CodingDino/6e7003ef9111bcf96f1bbae6facf49cf to your computer and use it in GitHub Desktop.
Save CodingDino/6e7003ef9111bcf96f1bbae6facf49cf to your computer and use it in GitHub Desktop.
Example of access modifiers used for Dog class
#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