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: Assume that when human resource managers are randomly selected, 53% say job applicants should follow…
Q: What is displayed after entering the following code into the Python interpreter? addition = 22 + 10…
Q: Hello, Can you please explain to me how to treat an infection with this organism "Toxoplasmosis" and…
Q: What does the pictorial flowchart symbol rectangle represent a)Datab)The operationc)…
Q: Hello, Can you please help me to describe the "Toxoplasmosis". Describe the species, classified as a…
Q: What does Blockly mean?   Network simulation software   Lowcost credit card…
Q: The dissociation constant for a weak, monoprotic electrolyte is 1.20x10-3. Calculate the percent…
Q: What is the only way to pay for prototyping?   a).Mortgage b).Easy payment…
Q: You have 150.0 mL of a 0.295 M solution of Ce(NO₃)₄. What mass (in grams) of Ce(NO₃)₄ would be…
Q: Describe the relevance of various communication models used for promoting physical activity…
Q: Calculate R8 for f(x)=6-x over [3,5]. R8 =________
Q: What output will be displayed if the code shown below is entered into a Python interpreter? y =…
Q: https://www.youtube.com/watch?v=7G_PuCIpaaM   Upon viewing the video on the inclusion of students…
Q: What does the pictorial flowchart that shape of diamond  symbol typically represent?…
Q: Consider the circuit shown in the figure below. (Let R = 38.0 2.) 10.0 Ω 25.0 V www 10.00 b w 5.00 3…
Q: What is the expected output when the function shown below is entered into a Python program…
Q: The circuit shown in the figure below is connected for 3.30 min. (Assume R₁ = 6.90 N, R₂ ww 5.00 €…
Q: Part C Learning Goal: A box of mass 3.0 kg slides down a rough vertical wall. The gravitational…
Q: an electrician needs to calculate voltage using this formula  (4-5i) (3+5i)
Q: Engineering Econ HW5 Q2
Q: Which of the following is a reserved word? Group of answer choices temperature snow for