subject

In java : define the following: 1. a superclass called item with itemcode and name as private variables. the item class should define:

a) a constructor method to assign values to both itemcode and name. b) a display method to display itemcode and name2. define an interface called discount, which should have the following method declaration.3. define another interface called tax, which should have the following method declaration. public double computetax(); 4. a sub class called grocery with the following private variables: double price; double units; double discount; the grocery class should define the following methods: 1) a constructor to assign values to price, units, discount and it has to call super class constructor to pass values to super class constructor.2) which is declared in the interface discount3) which is declared in tax interface4) double computetotalprice() to compute the final price for the item5) a method displaygrocery() to display itemcode, name, unit price, units, savings, subtotal, tax amount, and final price for the item. note: here the discount and tax are to be taken in percentage. the discount is optional, meaning you can buy an item without any discount at sometimes and with discount at other times. so, you pass 0 when there is no discount and you pass different percentages say 10 %, 20%, etc. at other times5. another sub class with the name clothing with the following private variables: private string brand; private double price; private double units; private double discount; final double taxp=8.5; the clothing class should define the following methods.1) a constructor to assign values to brand, unit price, units, discount and it has to call super class constructor to pass values to super class constructor.2) which is declared in the interface discount3) which is declared in tax interface4) double computetotalprice() to compute the final price for the item5) displayclothing()method to print: itemcode, name, brand, unit price, units, subtotal, savings, tax amount, and final price for the item. note: here the discount and tax are to be taken in percentage. the discount is optional, meaning you can buy an item without any discount at sometimes and with discount at other times. so, you pass 0 when there is no discount and you pass different percentages say 10 %, 20%, etc. at other times. all clothing items are 8.5% taxable6. a demodepartmentbilling class with the main method. in the main method, you should do the followinga. create two objects for grocery class: itemcode-11, name -bread, units -2, price-$1.50, discount-0, tax-0 itemcode-12, name- apple, units – 6, price-$0.75, discount-1%, tax-0b. create two objects for clothing class: itemcode-21, name- jeans, units-1, price-$35, brand-levis, discount0% itemcode-22, name- dress shirt, units-2, price-$25, brand-izod, discount-10 %c. find the total bill amount for all four items together and call displaygrocery() and displayclothing to print the details of the four objects and finally print the total bill amount.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
You know the right answer?
In java : define the following: 1. a superclass called item with itemcode and name as private varia...
Questions
question
Mathematics, 28.03.2021 22:40
question
Computers and Technology, 28.03.2021 22:40
question
Mathematics, 28.03.2021 22:40
question
Mathematics, 28.03.2021 22:40
question
Mathematics, 28.03.2021 22:40
Questions on the website: 13722361