The Animal Kingdom Begin by creating the inheritance structure found below, where Animal is an abstract...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Animal Kingdom Begin by creating the inheritance structure found below, where Animal is an abstract class with an abstract method called makeSound(). This means that all the sub classes need to implement it. Facts can usually by found on Wikipedia (or similar place), but here are some explanations. In Bird there is an attribute called isMigrant which defines if the bird migrates during seasons (to warmer countries). For the same class, the attribute nestType defines where the bird is making a nest -- in a tree, on the ground, making a hole and so on. For the Reptile the attribute Habitat defines where the reptile lives, for example in water, in the desert, in mountains and so on. Make a small main that shows that the program works -- use correct and actual data. You can set data directly in your program, no need to ask the user for input. Print out some of the data, not the least the sound. Note that the different types of animals has a different way of sounding (saying, tweeting and hizzing). Below is an example of what can be outputted: A Swedish red and white cattle says: Muuuuu! A Peafowl tweets: Kaka-kaka A Comodo dragon hizzes: kshhhhhh kshhhh < Animal -name: String -latinName: String -weight: double #sound: String +makeSound(): String Bird Order in the Animal Kingdom Mammal Reptile -isMigrant: boolean In new package, as we want you to re-write the classes for practice, we want you to make the animals comparable. This means that we want you to implement the Comparable interface so that the animals can be compared lexically on the latin name. -furColor: String -habitat: String -canFly: boolean -nestType: String -hasWinterFur: boolean -isPoisonous: boolean Comparable Animal Store at least six animals in an ArrayList and sort it before printing out the latin name as well as: nest type for birds, fur colour for mammals and habitat for reptiles. This means that you need to check each object for which class it belongs before printing out the information. An example print out is shown below: Apteryx mantelli puts its egg in/on a whole in the ground Bos taurus has a fur that is red and white Chelonia mydas lives in the sea Crocodilus niloticus lives in fresh water Panthera tigris has a fur that is yellow and black Pavo cristatus puts its egg in/on a whole in the ground The Animal Kingdom Begin by creating the inheritance structure found below, where Animal is an abstract class with an abstract method called makeSound(). This means that all the sub classes need to implement it. Facts can usually by found on Wikipedia (or similar place), but here are some explanations. In Bird there is an attribute called isMigrant which defines if the bird migrates during seasons (to warmer countries). For the same class, the attribute nestType defines where the bird is making a nest -- in a tree, on the ground, making a hole and so on. For the Reptile the attribute Habitat defines where the reptile lives, for example in water, in the desert, in mountains and so on. Make a small main that shows that the program works -- use correct and actual data. You can set data directly in your program, no need to ask the user for input. Print out some of the data, not the least the sound. Note that the different types of animals has a different way of sounding (saying, tweeting and hizzing). Below is an example of what can be outputted: A Swedish red and white cattle says: Muuuuu! A Peafowl tweets: Kaka-kaka A Comodo dragon hizzes: kshhhhhh kshhhh < Animal -name: String -latinName: String -weight: double #sound: String +makeSound(): String Bird Order in the Animal Kingdom Mammal Reptile -isMigrant: boolean In new package, as we want you to re-write the classes for practice, we want you to make the animals comparable. This means that we want you to implement the Comparable interface so that the animals can be compared lexically on the latin name. -furColor: String -habitat: String -canFly: boolean -nestType: String -hasWinterFur: boolean -isPoisonous: boolean Comparable Animal Store at least six animals in an ArrayList and sort it before printing out the latin name as well as: nest type for birds, fur colour for mammals and habitat for reptiles. This means that you need to check each object for which class it belongs before printing out the information. An example print out is shown below: Apteryx mantelli puts its egg in/on a whole in the ground Bos taurus has a fur that is red and white Chelonia mydas lives in the sea Crocodilus niloticus lives in fresh water Panthera tigris has a fur that is yellow and black Pavo cristatus puts its egg in/on a whole in the ground
Expert Answer:
Related Book For
Fundamentals Of Management
ISBN: 9781292307329
11th Global Edition
Authors: Stephen P. Robbins, Mary A. Coulter, David A. De Cenzo
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Nevada Department Stores is planning to sell its Spring Valley. Fernley, and Winchester stores. The firm expects to sell each of the three stores for the same, positive cash flow of SD. The firm...
-
A voltaic cell that uses the reaction Tl3+(aq) + 2 Cr2+(aq) Tl+(aq) + 2 Cr3+(aq) has a measured standard cell potential of + 1.19 V. (a) Write the two half-cell reactions. (b) By using data from...
-
Use the information for Geiberger AG from BE21.11, except assume the collectibility of the rentals is not probable. Prepare any journal entries for Geiberger on December 31, 2021. BE21.11 Geiberger...
-
Dogway Candy Company sells candy on consignment to "big-box" stores and currently has $\$ 1,000,000$ in accounts receivable. Its days sales outstanding (DSO) is 50 days (based on a 365-day year). The...
-
How do the customer and contractor know if each one completely understands the statement of work, the work breakdown structure, and the program plan?
-
Problem 6. (a) How many quadratic residues are in the residue set Z19? (b) Determine if 4 and 9 are quadratic residues mod 19. (c) Can you solve the congruence x 8 (mod 19)? [6 points]
-
Aluminum oxide melts at 2300 K, and the heat of fusion is 26 kcal/mole. Assuming that the internal energy and the entropy changes that take place in going from the solid to the liquid state are...
-
What are the elements of management systems?
-
How can personnel requirements be determined?
-
What conclusions can be drawn from a break-even calculation?
-
What is the relationship between objective and means?
-
Tesla Inc. has generated a lot of excitement about producing its Model 3 sedan, its electric car for the masses. The Model 3 begins at $35,000, while other luxury models Tesla produces cost...
-
Select two subjects from the following list of topics and write a 1,050-word analysis: Active monetary and fiscal policy Increased government spending to fight recessions Reducing federal...
-
An environmentalist wants to determine if the median amount of potassium (mg/L) in rainwater in Lincoln County, Nebraska, is different from that in the rainwater in Clarendon County, South Carolina....
-
On December 1, 2023, Rebecca Ward, a single taxpayer, comes to you for tax advice. At the end of every year, she donates \($5,000\) to charity. She has no other itemized deductions. This year, she...
-
Kelly and Chanelle Chambers, ages 47 and 45, are married and live at 584 Thoreau Drive, Boston, MA 59483. Kellys Social Security number is 111-11-1111 and Chanelles is 222-22-2222. The Chambers have...
-
Following is a list of information for Peter and Amy Jones for the current tax year. Peter and Amy are married and have three children, Aubrynne, Bryson, and Caden. They live at 100 Main Street,...
Study smarter with the SolutionInn App