1.) Write a program that produces the following output: // ==== OUTPUT: ---- Birds are vertebrates...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1.) Write a program that produces the following output: // ==== OUTPUT: ---- Birds are vertebrates in the Aves class. This pelican has gray feathers and weighs 8.5 pounds. Mammals are vertebrates in the Mammalia class. This black and white dairy cow weighs 500 pounds. Press any key to continue... * 2.) Use the following UML class diagrams to specify the 3 classes. UML Diagrams: Bird featherColor : string Mammal # _name: string Animal + Animal(name: string, weight: double): Mammal hairColor : string Bird + Bird(name: string, weight: double featherColor : string): Note: Both Animal and Bird classes have a showAnimal method. Which method gets called depends on the calling object. - + Mammal(name: string, weight: double hairColor : string): In main()... 1.) Declare a Bird object named: bird Pass these values to the constructor: The feathers are gray, weight is 8.5 and the name is pelican. 2.) Declare a Mammal object named: cow - Pass these values to the constructor: Hair color is black and white, weight is 500 and name is dairy cow. 3.) Each object should call its showAnimal function. 1.) Write a program that produces the following output: // ==== OUTPUT: ---- Birds are vertebrates in the Aves class. This pelican has gray feathers and weighs 8.5 pounds. Mammals are vertebrates in the Mammalia class. This black and white dairy cow weighs 500 pounds. Press any key to continue... * 2.) Use the following UML class diagrams to specify the 3 classes. UML Diagrams: Bird featherColor : string Mammal # _name: string Animal + Animal(name: string, weight: double): Mammal hairColor : string Bird + Bird(name: string, weight: double featherColor : string): Note: Both Animal and Bird classes have a showAnimal method. Which method gets called depends on the calling object. - + Mammal(name: string, weight: double hairColor : string): In main()... 1.) Declare a Bird object named: bird Pass these values to the constructor: The feathers are gray, weight is 8.5 and the name is pelican. 2.) Declare a Mammal object named: cow - Pass these values to the constructor: Hair color is black and white, weight is 500 and name is dairy cow. 3.) Each object should call its showAnimal function.
Expert Answer:
Answer rating: 100% (QA)
Animaljava public class Animal protected String name protected double weight public AnimalString nam... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
Write a program that produces the following output using nested for loops. Use a class constant to make it possible to change the number of stairs in the figure. ******* /* ****** ****** / * ****** /*
-
Write a program that produces the following output using nested for loops: ////**... **. ..... ... .... ... ..
-
Write a program that produces the following output: ********************************** * Programming Assignment 1 * * Computer Programming I * * Author: ??? * * Due Date: Thursday, Jan. 24 *...
-
Lockdown forcing construction sector to think more strategically about tech adoption. Why?
-
A random sample of 100 Modern Art dining room tables that came off the firm's assembly line is examined. Careful inspection reveals a total of 2,000 blemishes. What are the 99.7% upper and lower...
-
Activity 2: Post journal entries and reconcile discrepancies This activity requires the student to post journal entries and reconcile discrepancies based on the information given in the case study....
-
A food processor claims that at most \(10 \%\) of her jars of instant coffee contain less coffee than claimed on the label. To test this claim, 16 jars of her instant coffee are randomly selected and...
-
1. Advise Sara on whether she is really learning some valuable lessons as a potential manager. 2. What should Sara tell Johnny on her review of her experiences? 3. Which managerial roles has Sara...
-
5. The picture to the left shows a bucket connected to a massless rope, which runs over a massless, frictionless pulley. A man standing inside the bucket pulls the rope downwards in order to raise...
-
Pathfinder College is a small liberal arts college that wants to improve its admissions process. In particular, too many of its incoming freshmen have failed to graduate for a variety of reasons,...
-
What is the formula for PE Ratio?
-
A system consists of two interacting particles 1 and 2 , with particle 1 confined to an \(x\) axis and the system in equilibrium when particle 1 is at a given position on that axis. If displacing...
-
David Samarin, network administrator for OrangeWerks, laced his shoes as he prepared to head out for his exercise break in Ottawa. It was February 7, 2011, and Samarin needed to decide what to do...
-
Is it possible for a force to be exerted on an object along the direction of the object's motion and still produce no change in the object's kinetic energy? If yes, give an example. If no, explain...
-
In November of 2011, Bob Paulson was appointed as the new Commissioner of the Royal Canadian Mounted Police (RCMP), becoming the 23rd Commissioner. However, Paulsons appointment came at a critical...
-
A person is sitting on a stool in an elevator. The forces exerted on the stool are a downward force of magnitude \(60 \mathrm{~N}\) exerted by Earth, a downward force of magnitude \(780 \mathrm{~N}\)...
-
Suppose Fine Chocolates Co. estimates bad debt under the aging method. Before adjusting entries at year end, the following accounts had these normal balances: Accounts Receivable: $4,000 Allowance...
-
Identify the Critical Infrastructure Physical Protection System Plan.
-
Write a program that produces as output the lyrics to the repetitive song, There Was an Old Lady Who Swallowed a Fly, by Simms Taback. Use methods for each verse and the refrain. Your methods should...
-
Write a method called mirror that doubles the size of a list by appending the mirror image of the original sequence to the end of the list. The mirror image is the same sequence of values in reverse...
-
Add the following accessor method to the Point class: public int manhattanDistance(Point other) Returns the Manhattan distance between the current Point object and the given other Point object. The...
-
What methods can a company use to raise capital?
-
Does higher expected inflation increase, decrease, or have no effect on the required rate of return?
-
What are some of the advantages of equity financing?
Study smarter with the SolutionInn App