(Solved):Question: (1) Create two files to submit: ItemToPurchase.jav… (1) Create two files to submit: ItemToPurchase.java – Class definition ShoppingCartPrinter.java – Contains main() method Build the It… View Answer…

 

Question

Question: (1) Create two files to submit: ItemToPurchase.jav…

(1) Create two files to submit:

ItemToPurchase.java – Class definition

ShoppingCartPrinter.java – Contains main() method

Build the ItemToPurchase class with the following specifications:

Private fields

String itemName – Initialized in default constructor to “none”

int itemPrice – Initialized in default constructor to 0

int itemQuantity – Initialized in default constructor to 0

Default constructor

Public member methods (mutators & accessors)

setName() & getName()

setPrice() & getPrice()

setQuantity() & getQuantity()

(2) In main(), prompt the user for

Scroll to top