csci3081/ducks/duck2.h
Michael Zhang 1ba4536588
f
2018-01-29 17:24:20 -06:00

20 lines
376 B
C++

#include <iostream>
#include <string>
using std::string;
class DuckClass {
protected:
string typeOf;
string name;
public:
DuckClass() {
typeOf = "duck";
name = "noname";
}
void display() { std::cout << "I am " << name << ", and I am a " << typeOf << ".\n"; }
void fly() { std::cout << "I fly.\n"; };
void quack() { std::cout << "I quack.\n"; };
};