Create a Duck class. The attributes of Duck are: number and energy Implement the following methods: Duck(int); //Constructor to assign a number to duck and set its energy to 10 void eat(); //when duck eats, energy increases by 3 void swim(); //when duck swims, energy decreases by 2 void walk(); //when duck walks, energy decreases by 1 void print(); //prints energy of duck   Then  Create a Monkey class. The attributes of Monkey are: number and energy Implement the following methods: Monkey(int); //Constructor to assign a number to monkey and set its energy to 10 void eat(); //when monkey eats, energy increases by 10 void jump(); //when monkey jumps, energy decreases by 4 void walk(); //when monkey walks, energy decreases by 2 void print(); //prints energy of monkey You need to make a Zoo with following requirements: Duck lives in a Zoo Monkey lives in a Zoo Zoo has 10 ducks (Hint: You will need an array of pointers to Duck class) Zoo has 5 monkeys (Hint: You will need an array of pointers to Monkey class) Zoo can make all ducks eat Zoo can make all monkeys eat Zoo can make all ducks swim Zoo can make all ducks walk Zoo can print energies of all ducks Zoo can print energies of all monkeys Overload all the functions of Zoo class with 'number of ducks'/'number of monkeys' as parameter. Classes should be defined in Functions.h Additional function(s) should be written in Functions.cpp and used in main.cpp

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create a Duck class.

The attributes of Duck are: number and energy Implement the following methods: Duck(int); //Constructor to assign a number to duck and set its energy to 10 void eat(); //when duck eats, energy increases by 3 void swim(); //when duck swims, energy decreases by 2 void walk(); //when duck walks, energy decreases by 1 void print(); //prints energy of duck

 

Then 

Create a Monkey class.

The attributes of Monkey are: number and energy Implement the following methods: Monkey(int); //Constructor to assign a number to monkey and set its energy to 10 void eat(); //when monkey eats, energy increases by 10 void jump(); //when monkey jumps, energy decreases by 4 void walk(); //when monkey walks, energy decreases by 2 void print(); //prints energy of monkey

You need to make a Zoo with following requirements:

Duck lives in a Zoo Monkey lives in a Zoo Zoo has 10 ducks (Hint: You will need an array of pointers to Duck class) Zoo has 5 monkeys (Hint: You will need an array of pointers to Monkey class) Zoo can make all ducks eat Zoo can make all monkeys eat Zoo can make all ducks swim Zoo can make all ducks walk Zoo can print energies of all ducks Zoo can print energies of all monkeys

Overload all the functions of Zoo class with 'number of ducks'/'number of monkeys' as parameter.

Classes should be defined in Functions.h

Additional function(s) should be written in Functions.cpp and used in main.cpp

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY

Expert Answers to Latest Homework Questions

Q: A hypothesis regarding the weight of newborn infants at a community hospital is that the mean is…
Q: 800 p'(x) = = find price-supply (4x+50)²' equation if didtributor is willing to supply 300 boxes…
Q: Why are you learning tax accounting? Does your why in any way related to the business "why"? No…
Q: Identifying, measuring, and articulating a technical debt is not a significant challenge. A. True…
Q: Making users aware of the risks of information security is not the primary mechanism for addressing…
Q: Saline solution is delivered into a patient’s vein through a needle. The saline solution has a…
Q: 3:49 Rates and percentages: Quiz 2 The square below represents one whole. Express the shaded area as…
Q: The decision to invest in and implement Emerging Technology is a science, not an art. A. True B.…
Q: Given the following data: 25Al atom mass = 24.9904281 u 1H-atom mass = 1.007825 u neutron =…
Q: Ice.... when it gains.... and forms....
Q: find the height of a trapezoid with median 12 and area 84
Q: Watters Umbrella Corp. issued 20-year bonds 2 years ago at a coupon rate of 8.6 percent. The bonds…
Q: Given the following data: 27Na atom mass = 26.994077 u 1H-atom mass = 1.007825 u neutron =…
Q: Consider a monopoly where the inverse demand for its product is given by P = 200 - 5Q. Based on this…
Q: please answer in text form and in proper format answer with must explanation , calculation for each…
Q: Which of the following statements regarding the Federal Open Market Committee is correct a)All…
Q: Question 3 A project with the following costs are under consideration to determine its…
Q: The $12.6 trillion total market value of commercial real estate can be broken into four quadrants.…
Q: Discuss at least two (2) methods and provide examples of how an effective negotiator can avoid…
Q: Explain and provide at least two (2) examples for the term “risk assessment” during a negotiation.
Q: Explain the strategy and philosophy and regarding the following terms: “Negotiating the best deal…