Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

m doing exercise 9-1: Create and work with interfaces; in the Murach's java programming 4th edition. 4) Edit the Product class so it implements the

m doing exercise 9-1: Create and work with interfaces; in the Murach's java programming 4th edition.

4) Edit the Product class so it implements the Displayable interface. The getDisplayText method in this class should format a string that can be used to display the product information.

5) Edit the Employee class so it Implements the DepartmentConstants and Displayable interfaces. The getDisplayText method in this class should work like the one in the Product class, and it should use the constants in the DepartmentConstants interface to include the department name in the return value.

6) Open the DisplayableTestApp class and code to it that creates an Employee object, assigns it to a Displayable variable, and displays the information in the Employee object at the console. To get the information for an employee, you'll need to use the getDisplayText method of the Displayable interface.

7) Run the application to make sure that it displays the employee information.

8) Repeat steps 6 and 7 for a Product object.

9) Open the DisplayableTestApp class and add a method with this signature: private static String displayMultiple(Displayable d, int count)

write the code for this method so it returns a string that contains the Displayable parameter the number of times specified by the int parameter.

10) Modify the code in the main method so it uses the displayMultiple method to display the employee information once and the product information twice.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

Do you talk about them as if they are giving you gifts?

Answered: 1 week ago

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago

Question

2. How will you handle the situation?

Answered: 1 week ago