Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Table 2 . 1 UML Class Diagram ( Discount ) Part 2 ( Implement an Interface ) : For this question, you will create an
Table UML Class Diagram Discount
Part Implement an Interface:
For this question, you will create an Item class that will give implementation to the capabilities as specified in the Discount interface you created in Part
Follow the given UML class diagram Table and the description table Table and complete the Item concrete class.
Table UML Class Diagram Item
Table Class Description ItemQuestion Abstract Class:
Preparation:
Create a new NetBeans project called Question
Add a new Java Class called Switch to the Question project and complete the class as described in Part below.
The question:
Create a class called Switch to be abstract as shown in the UML class diagram Table The class will contain only one abstract method called press The
method should receive one parameter called the status of type char and should return a boolean data type.
Submitting your answers:
Follow the instructions on EC under section and submit your answers to this question.
Question Interface:
Preparation:
Create a new NetBeans project called Question
Add a new Java Interface called Discount to the Question project and complete the interface as described in Part below.
Add a new Java Class called Item to the Question project and complete the class as described in Part below.
Part Create an Interface:
Create an interface called Discount as shown in the UML class diagram Table This interface could be used to apply a discount to an object.
The interface will have a data member called DISCOUNTPERCENTAGE and will have a floatingpoint value of assigned to it The interface will also have
an abstract method called applyDiscount that will allow an object to apply a discount. This method should have a return type of type double.
Make sure that you code all the relevant access modifiers for the data member and the method of this interface.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started