Reference no: EM131937089
Assignment
Using Abstract Classes and Methods Create the Java source code files for the classes listed in the inheritance hierarchy displayed in Figure 10-60a. Create a new Java source code file and enter code for the AbstractTest.java test program, as shown in Figure 10-60b. Compile all source code and execute the test program to obtain the output as displayed in Figure 10-60c. Perform the following steps to complete these tasks:
1. Create an abstract base class, Animal. The single constructor requires a String to indicate the type of animal, which then is stored in an instance variable.
2. Create a concrete class, Cat, which inherits from Animal. Cat has two instance variables, both Strings: name, which has private access and breed, which has protected access.
3. Create an abstract class, Bird, which inherits from Animal. Bird has a single instance variable, breed, of type String with protected access. Bird implements only the required move() method.
4. Create a concrete class, Robin, which inherits from Bird. Robin has a single instance variable, name, of type String with private access. Robin implements the remaining required methods.
5. Compile all source code and execute the test program to obtain the output as displayed in Figure 10-60c.
6. Create a Dog class and a Fish class, both inheriting from Animal.
7. Re-write Abstract Test (Figure 10-60b) as LoopTest.java. Create an arrray of Animal and then loop through the array using an enhanced for(), calling the describe(), sound(), sleep(), and move() methods, successively. Save and then print your source code.
8 Change LoopTest.java to use an Array List instead of an array. Print your source code and indicate whether or not your for() loop had to be modified when changing from an array to an Array List.
![580_Figure 10-60a.jpg](https://secure.expertsmind.com/CMSImages/580_Figure 10-60a.jpg)
![2100_Figure 10-60b.jpg](https://secure.expertsmind.com/CMSImages/2100_Figure 10-60b.jpg)
Create java source code files to implement a callback method
: Create the necessary Java source code files to implement a callback method from two child windows to a parent window, as displayed in Figure 10-64.
|
Create the java source code files for the classes listed
: Create the Java source code files for the classes listed in the inheritance hierarchy displayed in Figure 10-63a.
|
What is the expected annual amount of electricity
: What is the expected annual amount of electricity that the plant will generate, in megawatt-hours?
|
How would you plan a training program
: Assume you are the human resource manager of a small seafood company. The general manager has told you that customers have begun complaining about the quality.
|
Create an abstract base class animal
: Create an abstract base class, Animal. The single constructor requires a String to indicate the type of animal, which then is stored in an instance variable.
|
How much would you be willing to pay for that security
: The required return on security is 10%. how much would you be willing to pay for that security today? Please show work and do not use Excel.
|
What is the firm wacc
: Assume that you are an intern with the Brayton Company, and you have collected the following data: The yield on the company's outstanding bonds is 7.75%.
|
Pea plant that bred true for green pods
: In one experiment, Mendel crossed a pea plant that bred true for green pods with one that bred true for yellow pods. All the F1 plants had green pods.
|
Compute dollar-weighted rate of return
: An investment fund has a balance of $10,000 on Jan 1, 2005. On June 1, 2005, the balance is $11,000.
|