Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Giant Panda Protection and Research Center in the Sichuan province of southwest China, actually employs a category of workers known as panda nannies.
The Giant Panda Protection and Research Center in the Sichuan province of southwest China, actually employs a category of workers known as panda nannies. The primary responsibility is to play with adorable panda cubs and name them, determine gender, keep track of their age and hours they sleep. So being a programmer panda nanny, you will create a code that will do all these works for you. 1. Create a class named Panda and also write the constructor. 2. Access the instance attributes and print them in the given format. 3. Call instance methods to keep track of their daily hours of sleep. 4. Suppose consulting with other panda nannies you have set some criteria based on which you will make their diet plans. The criteria are: ** Mixed Veggies for pandas having 3 to 5 hours (included) of sleep daily. ** Eggplant & Tofu for pandas having 6 to 8 hours (included) of sleep daily. ** Broccoli Chicken for pandas having 9 to 11 hours (included) of sleep daily. ** Lastly if no arguments are passed then just give it bamboo leaves. Now handle this problem modifying the method designed to keep track of their daily hours of sleep and determine diet plan using method overloading. [You are not allowed to change the code below]
Step by Step Solution
★★★★★
3.50 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
The detailed ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started