3. Classes and objects –
Create a class named Invoice that contains fields for an item number, name, quantity, price, and total cost. Create instance methods that set the item name, quantity, and price. Use a constructor to initialize the values for Item number, name, quantity, price and totalcost should be set to zero. Whenever the price or quantity is set, recalculate the total (price times quantity). Also include a displayLine() method that displays the item number, name, quantity, price, and total cost.
Create a class named InvoiceDriver whose main() method declares three Invoice items. Create a method that prompts the user for and accepts values for the item number, name, quantity, and price for each Invoice. Then display each completed object.
Answers
Answered by
0
Answer:
sorry!i am not knowing your answer
Similar questions