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: The following information relates to AmBen Ltd, a publishing company. The selling price of a book is…
Q: Which of the following are a part of capital budgeting? More than one answer may be correct.…
Q: The capital budgeting method used to find the length of time required for an investment’s discounted…
Q: 5 of 25 Concepts completed Ordering Question Click and drag on elements in order Place the steps…
Q: A project should be Blank______ if its NPV is greater than zero. Multiple choice question.…
Q: The Blank______ method is both intuitive and easy to understand. Multiple choice question.…
Q: According to the Blank______, an investment is acceptable if its discounted payback is less than…
Q: True or false: The payback period rule ignores the time value of money. True false question. True…
Q: Capital budgeting can also be referred to as Blank______. Multiple choice question. capital…
Q: The discounted payback period is the length of time until the sum of the discounted cash flows…
Q: What is the basic net present value (NPV) investment rule? More than one answer may be correct.…
Q: Identify the true statements about the payback period method. More than one answer may be correct.…
Q: One of the flaws of the payback period method is that cash flows after the cutoff date are…
Q: A spirometry experiment was conducted on a female who is, 45 years old, 1.65meters height, 80kg…
Q: Question 2 Let A be the region on the right of the y-axis and bounded by y = 6 — 2x² and a² (da dy).…
Q: Question 1 1 pts The density of the rectangular plate [2,3] × [1,4] in the x, y-plane is p = y/(3 +…
Q: ______ is a measure of how much value is created or added today by undertaking an investment.…
Q: Which of the following are a part of capital budgeting? More than one answer may be correct.…
Q: The payback period is the amount of time required for an investment to generate cash flows to…
Q: A project should be Blank______ if its NPV is greater than zero. Multiple choice question.…
Q: In the discounted cash flow (DCF) valuation method, the NPV of a project is calculated as the…