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, 22.06.2019 01:30
What “old fashioned” features of checking accounts is p2p replacing
Answers: 3
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
You know the right answer?
Create an abstract class named animal. this class should have a private name variable of type string...
Questions
question
Mathematics, 06.07.2019 02:00
question
History, 06.07.2019 02:00
question
History, 06.07.2019 02:00
question
History, 06.07.2019 02:00
question
Mathematics, 06.07.2019 02:00
Questions on the website: 13722367