-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimal.cpp
More file actions
63 lines (48 loc) · 1.34 KB
/
Animal.cpp
File metadata and controls
63 lines (48 loc) · 1.34 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/****************************************************************************************************
* * Program name: CS162 Project2
* * Author: Taekyoung Kim
* * Date: 01/21/2019
* * Description: This is Animal.cpp file for CS162 Project2
* * This project shows a zoo that has a few animals. We needs inheritance and class......
******************************************************************************************************/
#include "Animal.h"
#include <iostream>
Animal::Animal()=default;
Animal::Animal(int age, double cost, int numOfBabies, double baseFoodCost, double payoff){
this -> age =age;
this -> cost =cost;
this -> numOfBabies = numOfBabies;
this -> baseFoodCost = baseFoodCost;
this -> payoff = payoff;
}
Animal::~Animal()=default;
int Animal::getAge() {
return this -> age;
}
void Animal::setAge(int a){
age = a;
}
double Animal::getCost(){
return this ->cost;
}
void Animal::setCost(double co){
cost = co;
}
int Animal::getNumOfBabies(){
return this ->numOfBabies;
}
void Animal::setNumOfBabies(int babies){
numOfBabies = babies;
}
double Animal::getBaseFoodCost(){
return this -> baseFoodCost;
}
void Animal::setBaseFoodCost(double fCost){
baseFoodCost =fCost;
}
double Animal::getPayoff(){
return this -> payoff;
}
void Animal::setPayoff(double pay){
payoff = pay;
}