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, 21.06.2019 21:00
If you have a lien on your vehicle, you cannot apply for a duplicate copy of your vehicle’s certificate of title. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
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, 17.10.2019 20:50
question
History, 17.10.2019 20:50
question
Mathematics, 17.10.2019 20:50
question
Mathematics, 17.10.2019 20:50
question
Chemistry, 17.10.2019 20:50
Questions on the website: 13722362