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, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
question
Computers and Technology, 24.06.2019 18:20
7. design a circuit with three inputs (x, y, and z) representing the bits in a binary number, and three outputs (a, b, and c) also representing bits in a binary number. when the input is 1, 2, or 3, the binary output should be one lesser than the input. when the input is 4, 5, or 6, the binary output should be one greater than the input. when the input is 0, the output is 0, and when the input is 7, the output is 7. show your truth table, all computations for simplification, and the final circuit.
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, 28.05.2021 17:00
Questions on the website: 13722362