subject
Computers and Technology, 30.10.2019 04:31 Duriiee

Create an abstract class named animal. this class should have a private name variable of type string, and contain these constructors and methods: public animal(string name) public string getname() public void setname(string name) public string getnameandtype() public abstract void speak() protected void speak(consumer consumer) the getnameandtype() method should return the animal's name concatenated with 'the' and the type of the class (example: 'percy the cat'). create subclasses named dog, cat, and turtle that extend the animal class. these classes should have constructors that call the constructor of the parent class. when the subclasses override the abstract speak() method, they should call the protected speak() method of the parent class and pass it a function. this function contains the functionality for the speak() method for that subclass. you should be able to easily modify this class so an animal 'speaks' by printing data to the console or by displaying a gui dialog box. after the user has entered all the animals they want, each animal that they've entered should 'speak'. use the console class from chapter 7 or a variation of it to validate the user's input.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
In a heat transfer course, we can derive the equation for the temperature distribution in a flat rectangular plate. in this example, we will look at a plate at steadystate with three sides being held at t1, and one side held at t2. the temperature for any location on the plate, t(x,y), can be calculated by where create a function (prob3_5) that will take inputs of vectors x and y in feet, scalar n, scalars l and w in feet and scalars t1 and t2 in degrees fahrenheit. it will output a matrix t which is the temperature of each x and y locations. t will have the number of columns equal to the number of elements in x and rows equal to the number of elements in y. though this can be done without loops (perhaps more efficiently), your program must use a nested loop.
Answers: 2
question
Computers and Technology, 24.06.2019 18:00
Which of the following is an example of synchronous communication? a) e-mail b) voicemail c) telephone conversation d) text message.
Answers: 1
You know the right answer?
Create an abstract class named animal. this class should have a private name variable of type string...
Questions
Questions on the website: 13722363