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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, jhonpiper
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, jacobbecker99
Choose the correct citation for the case which established the "minimum contacts" test for a court's jurisdiction in a case. select one: a. brown v. board of education of topeka, 347 u. s. 483 (1954). b. international shoe co. v. washington, 326 u. s. 310 (1945) c. haynes v. gore, 531 u. s. 98 (2000). d. international shoe co. v. washington, 14 u. s. code 336.
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, petergriffin6772
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
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 in other subjects:

Konu
History, 24.09.2020 06:01
Konu
Mathematics, 24.09.2020 06:01
Konu
Social Studies, 24.09.2020 06:01